- Fixed: Item tossing did not work anymore.

SVN r1502 (trunk)
This commit is contained in:
Christoph Oelckers 2009-03-24 07:51:15 +00:00
parent e4da63e9f3
commit 218fc5018e
3 changed files with 21 additions and 14 deletions

View file

@ -1,4 +1,7 @@
March 23, 2009 (Changes by Graf Zahl) March 24, 2009 (Changes by Graf Zahl)
- Fixed: Item tossing did not work anymore.
March 23, 2009 (Changes by Graf Zahl)
- Changed: Making the gameinfo customizable by MAPINFO requires different - Changed: Making the gameinfo customizable by MAPINFO requires different
checks for map specific border flats. checks for map specific border flats.

View file

@ -507,6 +507,7 @@ add_executable( zdoom WIN32
nodebuild_extract.cpp nodebuild_extract.cpp
nodebuild_gl.cpp nodebuild_gl.cpp
nodebuild_utility.cpp nodebuild_utility.cpp
p_3dfloors.cpp
p_3dmidtex.cpp p_3dmidtex.cpp
p_acs.cpp p_acs.cpp
p_buildmap.cpp p_buildmap.cpp

View file

@ -2507,23 +2507,26 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int
} }
} }
mo = Spawn (type, source->x, source->y, spawnz, ALLOW_REPLACE); mo = Spawn (type, source->x, source->y, spawnz, ALLOW_REPLACE);
mo->flags |= MF_DROPPED; if (mo != NULL)
mo->flags &= ~MF_NOGRAVITY; // [RH] Make sure it is affected by gravity
if (mo->IsKindOf (RUNTIME_CLASS(AInventory)))
{ {
AInventory * inv = static_cast<AInventory *>(mo); mo->flags |= MF_DROPPED;
ModifyDropAmount(inv, dropamount); mo->flags &= ~MF_NOGRAVITY; // [RH] Make sure it is affected by gravity
if (inv->SpecialDropAction (source)) if (!(i_compatflags & COMPATF_NOTOSSDROPS))
{ {
return NULL; P_TossItem (mo);
} }
return inv; if (mo->IsKindOf (RUNTIME_CLASS(AInventory)))
{
AInventory * inv = static_cast<AInventory *>(mo);
ModifyDropAmount(inv, dropamount);
if (inv->SpecialDropAction (source))
{
return NULL;
}
return inv;
}
// we can't really return an AInventory pointer to a non-inventory item here, can we?
} }
if (!(i_compatflags & COMPATF_NOTOSSDROPS))
{
P_TossItem (mo);
}
// we can't really return an AInventory pointer to a non-inventory item here, can we?
} }
return NULL; return NULL;
} }