Merge commit 'ec58178695' into scripting
Conflicts: src/p_enemy.cpp src/p_enemy.h wadsrc/static/actors/constants.txt (Scripting branch update part 1)
This commit is contained in:
commit
56989d3422
19 changed files with 170 additions and 58 deletions
|
|
@ -1418,6 +1418,8 @@ bool AInventory::TryPickupRestricted (AActor *&toucher)
|
|||
|
||||
bool AInventory::CallTryPickup (AActor *toucher, AActor **toucher_return)
|
||||
{
|
||||
TObjPtr<AInventory> Invstack = Inventory; // A pointer of the inventories item stack.
|
||||
|
||||
// unmorphed versions of a currently morphed actor cannot pick up anything.
|
||||
if (toucher->flags & MF_UNMORPHED) return false;
|
||||
|
||||
|
|
@ -1438,7 +1440,27 @@ bool AInventory::CallTryPickup (AActor *toucher, AActor **toucher_return)
|
|||
GoAwayAndDie();
|
||||
}
|
||||
|
||||
if (res) GiveQuest(toucher);
|
||||
if (res)
|
||||
{
|
||||
GiveQuest(toucher);
|
||||
|
||||
// Transfer all inventory accross that the old object had, if requested.
|
||||
if ((ItemFlags & IF_TRANSFER))
|
||||
{
|
||||
while (Invstack)
|
||||
{
|
||||
AInventory* titem = Invstack;
|
||||
Invstack = titem->Inventory;
|
||||
if (titem->Owner == this)
|
||||
{
|
||||
if (!titem->CallTryPickup(toucher)) // The object no longer can exist
|
||||
{
|
||||
titem->Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue