1216 {
1217 super.OnItemLocationChanged(old_owner, new_owner);
1218
1219 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
1220 PlayerBase playerNew = PlayerBase.Cast(new_owner);
1221
1222 if (!relatedPlayer && playerNew)
1223 relatedPlayer = playerNew;
1224
1225 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
1226 {
1228 if (actionMgr)
1229 {
1230 ActionBase currentAction = actionMgr.GetRunningAction();
1231 if (currentAction)
1233 }
1234 }
1235
1236 Man ownerPlayerOld = null;
1237 Man ownerPlayerNew = null;
1238
1239 if (old_owner)
1240 {
1241 if (old_owner.
IsMan())
1242 {
1243 ownerPlayerOld = Man.Cast(old_owner);
1244 }
1245 else
1246 {
1247 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
1248 }
1249 }
1250 else
1251 {
1252 if (new_owner && IsElectricAppliance() && GetCompEM() && GetCompEM().IsPlugged())
1253 {
1255
1256 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
1257 {
1258 GetCompEM().UnplugThis();
1259 }
1260 }
1261 }
1262
1263 if (new_owner)
1264 {
1265 if (new_owner.
IsMan())
1266 {
1267 ownerPlayerNew = Man.Cast(new_owner);
1268 }
1269 else
1270 {
1271 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
1272 }
1273 }
1274
1275 if (ownerPlayerOld != ownerPlayerNew)
1276 {
1277 if (ownerPlayerOld)
1278 {
1279 array<EntityAI> subItemsExit = new array<EntityAI>;
1281 for (int i = 0; i < subItemsExit.Count(); i++)
1282 {
1285 }
1286 }
1287
1288 if (ownerPlayerNew)
1289 {
1290 array<EntityAI> subItemsEnter = new array<EntityAI>;
1292 for (int j = 0; j < subItemsEnter.Count(); j++)
1293 {
1296 }
1297 }
1298 }
1299 else if (ownerPlayerNew != null)
1300 {
1301 PlayerBase nplayer;
1302 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
1303 {
1304 array<EntityAI> subItemsUpdate = new array<EntityAI>;
1306 for (int k = 0; k < subItemsUpdate.Count(); k++)
1307 {
1309 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
1310 }
1311 }
1312 }
1313
1314 if (old_owner)
1315 old_owner.OnChildItemRemoved(this);
1316 if (new_owner)
1317 new_owner.OnChildItemReceived(this);
1318 }
void ActionManagerBase(PlayerBase player)
void OnItemLocationChanged(ItemBase item)
override void OnInventoryEnter(Man player)
override void OnInventoryExit(Man player)
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal