mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- Fixed: If AbsorbDamage resulted in an item having been destroyed, the following items in the inventory chain were not processed.
This commit is contained in:
parent
75c791ecff
commit
7ff79546e4
1 changed files with 4 additions and 1 deletions
|
@ -3242,8 +3242,11 @@ bool AActor::AdjustReflectionAngle (AActor *thing, DAngle &angle)
|
||||||
|
|
||||||
int AActor::AbsorbDamage(int damage, FName dmgtype, AActor *inflictor, AActor *source, int flags)
|
int AActor::AbsorbDamage(int damage, FName dmgtype, AActor *inflictor, AActor *source, int flags)
|
||||||
{
|
{
|
||||||
for (AActor *item = Inventory; item != nullptr; item = item->Inventory)
|
AActor *next;
|
||||||
|
for (AActor *item = Inventory; item != nullptr; item = next)
|
||||||
{
|
{
|
||||||
|
// [Player701] Remember the next item now in case the current item is destroyed later
|
||||||
|
next = item->Inventory;
|
||||||
IFVIRTUALPTRNAME(item, NAME_Inventory, AbsorbDamage)
|
IFVIRTUALPTRNAME(item, NAME_Inventory, AbsorbDamage)
|
||||||
{
|
{
|
||||||
VMValue params[7] = { item, damage, dmgtype.GetIndex(), &damage, inflictor, source, flags };
|
VMValue params[7] = { item, damage, dmgtype.GetIndex(), &damage, inflictor, source, flags };
|
||||||
|
|
Loading…
Reference in a new issue