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

◆ OnFinishProgressServer()

override void ActionPackGift::OnFinishProgressServer ( ActionData action_data)
inlineprivate

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

85 {
86 ItemBase item_to_pack = ItemBase.Cast(action_data.m_Target.GetObject());
87 ItemBase item = action_data.m_MainItem;
88 PlayerBase player = action_data.m_Player;
89 string typeName;
90
91 if (item_to_pack)
92 {
93 int x,y;
94 GetGame().GetInventoryItemSize( item_to_pack, x, y );
95 int rnd = Math.RandomIntInclusive(1, 4);
96
97 ReplaceWithNewReciveCargoLambda lambda;
98
99 if( x <= 2 && y <= 2 )
100 {
101 typeName = "GiftBox_Small_" + rnd;
102 }
103 else if( x <= 3 && y <= 3 )
104 {
105 typeName = "GiftBox_Medium_" + rnd;
106 }
107 else if( x <= 5 && y <= 5 )
108 {
109 typeName = "GiftBox_Large_" + rnd;
110 }
111 else return;
112
113
114 if(!GetGame().IsDedicatedServer())
115 player.RemoveQuickBarEntityShortcut(item_to_pack);
116
117 lambda = new ReplaceWithNewReciveCargoLambda( item, typeName, player,item_to_pack);
118 player.ServerReplaceItemWithNew(lambda);
119
120 }
121
122
123 }
class GP5GasMask extends MaskBase ItemBase
Icon x
Icon y
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
proto native CGame GetGame()

Перекрестные ссылки ActionData, GetGame(), CGame::GetInventoryItemSize(), Math::RandomIntInclusive(), x и y.