1053 {
1054 super.EEItemLocationChanged(oldLoc,newLoc);
1055
1056 PlayerBase new_player = null;
1057 PlayerBase old_player = null;
1058
1059 if (newLoc.GetParent())
1060 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
1061
1062 if (oldLoc.GetParent())
1063 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
1064
1066 {
1067 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
1068
1069 if (r_index >= 0)
1070 {
1071 InventoryLocation r_il = new InventoryLocation;
1072 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1073
1074 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1077 {
1078 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
1079 }
1081 {
1082 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
1083 }
1084
1085 }
1086 }
1087
1089 {
1090 if (new_player)
1091 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
1092
1093 if (new_player == old_player)
1094 {
1095
1096 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
1097 {
1099 {
1100 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
1101 {
1102 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
1103 }
1104 }
1105 else
1106 {
1107 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
1108 }
1109 }
1110
1111 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
1112 {
1113 int type = oldLoc.GetType();
1115 {
1116 oldLoc.GetParent().GetOnSetLock().Invoke(this);
1117 }
1119 {
1120 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
1121 }
1122 }
1123 if (!m_OldLocation)
1124 {
1125 m_OldLocation = new InventoryLocation;
1126 }
1127 m_OldLocation.Copy(oldLoc);
1128 }
1129 else
1130 {
1131 if (m_OldLocation)
1132 {
1133 m_OldLocation.Reset();
1134 }
1135 }
1136
1138 }
1139 else
1140 {
1141 if (new_player)
1142 {
1143 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
1144 if (res_index >= 0)
1145 {
1146 InventoryLocation il = new InventoryLocation;
1147 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
1149 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
1152 {
1153 il.
GetParent().GetOnReleaseLock().Invoke(it);
1154 }
1156 {
1158 }
1159
1160 }
1161 }
1163 {
1164
1166 }
1167
1168 if (m_OldLocation)
1169 {
1170 m_OldLocation.Reset();
1171 }
1172 }
1173 }
InventoryLocationType
types of Inventory Location
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
AnalyticsManagerClient GetAnalyticsClient()
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation
proto native EntityAI GetItem()
returns item of current inventory location
proto native CGame GetGame()