DayZ 1.29
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 строка 2086

2087 {
2088 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2089
2090 if (g_Game.IsServer())
2091 {
2092 if (newLevel == GameConstants.STATE_RUINED)
2093 {
2095 EntityAI parent = GetHierarchyParent();
2096 if (parent && parent.IsFireplace())
2097 {
2098 CargoBase cargo = GetInventory().GetCargo();
2099 if (cargo)
2100 {
2101 for (int i = 0; i < cargo.GetItemCount(); ++i)
2102 {
2103 parent.GetInventory().TakeEntityToInventory(InventoryMode.SERVER, FindInventoryLocationType.CARGO, cargo.GetItem(i));
2104 }
2105 }
2106 }
2107 }
2108
2109 if (IsResultOfSplit())
2110 {
2111 // reset the splitting result flag, return to normal item behavior
2112 SetResultOfSplit(false);
2113 return;
2114 }
2115
2116 if (m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2117 {
2118 SetCleanness(0);//unclean the item upon damage dealt
2119 }
2120 }
2121 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
bool IsResultOfSplit()
Определения ItemBase.c:2269
override void SetCleanness(int value, bool allow_client=false)
Определения ItemBase.c:3813
int m_Cleanness
Определения ItemBase.c:50
void SetResultOfSplit(bool value)
Определения ItemBase.c:2274

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