DayZ 1.29
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 = g_Game.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(g_Game.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
DayZGame g_Game
Определения DayZGame.c:3942
class GP5GasMask extends MaskBase ItemBase
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
class LOD Object

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