Fix RemoveInventory not calling DetachFromOwner when an item is the first in the owner's inventory.

Fix CheckAddToSlots not working because it uses GetReplacement incorrectly.
This commit is contained in:
Marisa Kirisame 2018-12-03 17:12:42 +01:00 committed by Christoph Oelckers
parent 53291b0abf
commit d6d3dd038e
2 changed files with 2 additions and 2 deletions

View File

@ -122,11 +122,11 @@ extend class Actor
if (invp.Inv == item) if (invp.Inv == item)
{ {
invp.Inv = item.Inv; invp.Inv = item.Inv;
item.DetachFromOwner();
break; break;
} }
} }
} }
item.DetachFromOwner();
item.Owner = NULL; item.Owner = NULL;
item.Inv = NULL; item.Inv = NULL;
} }

View File

@ -119,7 +119,7 @@ class Weapon : StateProvider
virtual int, int CheckAddToSlots() virtual int, int CheckAddToSlots()
{ {
if (GetReplacement(GetClass()) == null && !bPowered_Up) if (GetReplacement(GetClass()) == GetClass() && !bPowered_Up)
{ {
return SlotNumber, SlotPriority*65536; return SlotNumber, SlotPriority*65536;
} }