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

◆ EEHealthLevelChanged()

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

drops content of container when ruined in fireplace

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

2041 {
2042 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2043
2044 if (GetGame().IsServer())
2045 {
2046 if (newLevel == GameConstants.STATE_RUINED)
2047 {
2049 EntityAI parent = GetHierarchyParent();
2050 if (parent && parent.IsFireplace())
2051 {
2052 CargoBase cargo = GetInventory().GetCargo();
2053 if (cargo)
2054 {
2055 for (int i = 0; i < cargo.GetItemCount(); ++i)
2056 {
2057 parent.GetInventory().TakeEntityToInventory(InventoryMode.SERVER, FindInventoryLocationType.CARGO, cargo.GetItem(i));
2058 }
2059 }
2060 }
2061 }
2062
2063 if (IsResultOfSplit())
2064 {
2065 // reset the splitting result flag, return to normal item behavior
2066 SetResultOfSplit(false);
2067 return;
2068 }
2069
2070 if (m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2071 {
2072 SetCleanness(0);//unclean the item upon damage dealt
2073 }
2074 }
2075 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
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:2209
override void SetCleanness(int value, bool allow_client=false)
Определения ItemBase.c:3688
int m_Cleanness
Определения ItemBase.c:44
void SetResultOfSplit(bool value)
Определения ItemBase.c:2214
proto native CGame GetGame()

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