1054 {
1055#ifdef ENABLE_LOGGING
1057 {
1058 Debug.
ActionLog(
"STS = " + action_data.
m_Player.GetSimulationTimeStamp(),
this.ToString() ,
"n/a",
"InventoryReservation", action_data.
m_Player.ToString() );
1059 }
1060#endif
1061 if (
g_Game.IsDedicatedServer())
1062 return true;
1063
1065 return true;
1066
1067
1068 bool success = true;
1071
1072
1074 {
1077 {
1079 targetItem.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
1080 if ( action_data.
m_Player.GetInventory().HasInventoryReservation( targetItem, targetInventoryLocation) )
1081 {
1082 success = false;
1083 }
1084 else
1085 {
1087 }
1088 }
1089 }
1090
1093
1094 if (action_data.
m_Player.GetInventory().HasInventoryReservation( action_data.
m_Player.GetItemInHands(), handInventoryLocation))
1095 {
1097 {
1098 action_data.
m_Player.GetInventory().ClearInventoryReservation(targetItem, targetInventoryLocation);
1099 }
1100
1101 success = false;
1102 }
1103 else
1104 {
1106 }
1107
1108 if (success)
1109 {
1110 if (targetInventoryLocation)
1112
1113 if (handInventoryLocation)
1115 }
1116
1117 return success;
1118 }
ref ActionTarget m_Target
ref array< ref InventoryLocation > m_ReservedInventoryLocations
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
const int c_InventoryReservationTimeoutMS
reservations
script counterpart to engine's class Inventory
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
static bool IsActionLogEnable()