Fixed: the flags weren't properly reset if a mod used the old layers before the code used them

This commit is contained in:
Leonard2 2016-06-18 11:29:02 +02:00
parent 7ded355d5d
commit 75cb8c00a6
2 changed files with 8 additions and 4 deletions

View file

@ -216,14 +216,18 @@ DPSprite *player_t::GetPSprite(PSPLayers layer)
} }
// Always update the caller here in case we switched weapon // Always update the caller here in case we switched weapon
// or if the layer was being used by an inventory item before. // or if the layer was being used by something else before.
pspr->Caller = newcaller; pspr->Caller = newcaller;
if (newcaller != oldcaller) if (newcaller != oldcaller)
{ // Only change the flags if this layer was created now or if we updated the caller. { // Only reset flags if this layer was created now or if it was being used before.
if (layer >= PSP_TARGETCENTER) if (layer >= PSP_TARGETCENTER)
{ // The targeter layers were affected by those. { // The targeter layers were affected by those.
pspr->Flags |= (PSPF_CVARFAST|PSPF_POWDOUBLE); pspr->Flags = (PSPF_CVARFAST|PSPF_POWDOUBLE);
}
else
{
pspr->Flags = (PSPF_ADDWEAPON|PSPF_ADDBOB|PSPF_CVARFAST|PSPF_POWDOUBLE);
} }
} }

View file

@ -42,7 +42,7 @@ class FArchive;
// drawn directly on the view screen, // drawn directly on the view screen,
// coordinates are given for a 320*200 view screen. // coordinates are given for a 320*200 view screen.
// //
enum PSPLayers // These are all called by the owner's ReadyWeapon. enum PSPLayers
{ {
PSP_STRIFEHANDS = -1, PSP_STRIFEHANDS = -1,
PSP_WEAPON = 1, PSP_WEAPON = 1,