DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ EEHealthLevelChanged()

override void EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
protected

drops content of container when ruined in fireplace

См. определение в файле ItemBase.c строка 2021

2022 {
2023 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2024
2025 if (g_Game.IsServer())
2026 {
2027 if (newLevel == GameConstants.STATE_RUINED)
2028 {
2030 EntityAI parent = GetHierarchyParent();
2031 if (parent && parent.IsFireplace())
2032 {
2033 CargoBase cargo = GetInventory().GetCargo();
2034 if (cargo)
2035 {
2036 for (int i = 0; i < cargo.GetItemCount(); ++i)
2037 {
2038 parent.GetInventory().TakeEntityToInventory(InventoryMode.SERVER, FindInventoryLocationType.CARGO, cargo.GetItem(i));
2039 }
2040 }
2041 }
2042 }
2043
2044 if (IsResultOfSplit())
2045 {
2046 // reset the splitting result flag, return to normal item behavior
2047 SetResultOfSplit(false);
2048 return;
2049 }
2050
2051 if (m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2052 {
2053 SetCleanness(0);//unclean the item upon damage dealt
2054 }
2055 }
2056 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:4074
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
void SetResultOfSplit(bool value)
Определения ItemBase.c:2209
override void SetCleanness(int value, bool allow_client=false)
Определения ItemBase.c:3791
int m_Cleanness
Определения ItemBase.c:46
bool IsResultOfSplit()
Определения ItemBase.c:2204
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Определения Cargo.c:7
const int STATE_RUINED
Определения 3_Game/DayZ/constants.c:909

Перекрестные ссылки g_Game, CargoBase::GetItem(), CargoBase::GetItemCount(), IsResultOfSplit(), m_Cleanness, SetCleanness(), SetResultOfSplit() и GameConstants::STATE_RUINED.