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

◆ OnFinishProgressServer()

override void ActionUnpackGift::OnFinishProgressServer ( ActionData action_data)
inlineprivate

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

38 {
39 ItemBase item = ItemBase.Cast(action_data.m_MainItem);
40
41 CargoBase cargo = item.GetInventory().GetCargo();
42
43 InventoryLocation il_dst = new InventoryLocation;
44 InventoryLocation il_src = new InventoryLocation;
45
46 float dmg = item.GetHealth01("","");
47
48 if( dmg > 0.25 )
49 {
50 Object paper = GetGame().CreateObjectEx("GiftWrapPaper",action_data.m_Player.GetPosition(),ECE_PLACE_ON_SURFACE,RF_DEFAULT);
51 paper.SetHealth01("","", dmg - 0.25 );
52 }
53
54 for(int i = cargo.GetItemCount() - 1; i >= 0 ; i--)
55 {
56 EntityAI cargo_item = cargo.GetItem(i);
57
58 GameInventory.SetGroundPosByOwner(action_data.m_Player,cargo_item,il_dst);
59 cargo_item.GetInventory().GetCurrentInventoryLocation(il_src);
60
61 if(GetGame().IsDedicatedServer())
62 action_data.m_Player.ServerTakeToDst( il_src, il_dst );
63 else
64 action_data.m_Player.LocalTakeToDst( il_src, il_dst );
65 }
66
67 item.DeleteSafe();
68 }
class LogManager EntityAI
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int RF_DEFAULT
Определения CentralEconomy.c:65
class GP5GasMask extends MaskBase ItemBase
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
class LOD Object
proto native CGame GetGame()

Перекрестные ссылки ActionData, CGame::CreateObjectEx(), ECE_PLACE_ON_SURFACE, GetGame(), CargoBase::GetItem(), CargoBase::GetItemCount(), RF_DEFAULT и GameInventory::SetGroundPosByOwner().