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

◆ OnExecuteServer()

override void ActionTakeFireplaceFromBarrel::OnExecuteServer ( ActionData action_data)
inlineprivate

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

34 {
35 Object target_object = action_data.m_Target.GetObject();
36 BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( target_object );
37
38 string newTypeName = "Fireplace";
39 InventoryLocation targetIL = new InventoryLocation;
40 bool found = action_data.m_Player.GetInventory().FindFirstFreeLocationForNewEntity( newTypeName, FindInventoryLocationType.ANY, targetIL );
41 if ( found )
42 {
43 // allow action only if there is place in inventory
44 auto lambda = TakeFireplaceFromBarrelLambda( fireplace_barrel, newTypeName, action_data.m_Player );
45 lambda.OverrideNewLocation( targetIL );
46 action_data.m_Player.ServerReplaceItemWithNew( lambda );
47 }
48 }
void TakeFireplaceFromBarrelLambda(EntityAI old_item, string new_item_type, PlayerBase player)
Определения ActionTakeFireplaceFromBarrel.c:55
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
class LOD Object

Перекрестные ссылки ActionData и TakeFireplaceFromBarrelLambda().