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

◆ EEHealthLevelChanged()

override void InventoryItem::EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprotected

drops content of container when ruined in fireplace

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

2061 {
2062 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2063
2064 if (GetGame().IsServer())
2065 {
2066 if (newLevel == GameConstants.STATE_RUINED)
2067 {
2069 EntityAI parent = GetHierarchyParent();
2070 if (parent && parent.IsFireplace())
2071 {
2072 CargoBase cargo = GetInventory().GetCargo();
2073 if (cargo)
2074 {
2075 for (int i = 0; i < cargo.GetItemCount(); ++i)
2076 {
2077 parent.GetInventory().TakeEntityToInventory(InventoryMode.SERVER, FindInventoryLocationType.CARGO, cargo.GetItem(i));
2078 }
2079 }
2080 }
2081 }
2082
2083 if (IsResultOfSplit())
2084 {
2085 // reset the splitting result flag, return to normal item behavior
2086 SetResultOfSplit(false);
2087 return;
2088 }
2089
2090 if (m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2091 {
2092 SetCleanness(0);//unclean the item upon damage dealt
2093 }
2094 }
2095 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
class LogManager EntityAI
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
bool IsResultOfSplit()
Определения ItemBase.c:2243
override void SetCleanness(int value, bool allow_client=false)
Определения ItemBase.c:3758
int m_Cleanness
Определения ItemBase.c:44
void SetResultOfSplit(bool value)
Определения ItemBase.c:2248
proto native CGame GetGame()

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