- Added read and write barriers to the actor pointer in the sound channel
structure. - Fixed: Items which should stay but had an IF_ALWAYSPICKUP flag were removed. - Fixed: The pickup flash must only play when an item is picked up so the correct place to spawn it is in AInventory::Touch, not in AInventory::GoAway. SVN r1278 (trunk)
This commit is contained in:
parent
226ca44939
commit
a8a3aca601
7 changed files with 68 additions and 22 deletions
|
|
@ -553,19 +553,11 @@ bool AInventory::GoAway ()
|
|||
// Dropped items never stick around
|
||||
if (flags & MF_DROPPED)
|
||||
{
|
||||
if (PickupFlash != NULL)
|
||||
{
|
||||
Spawn(PickupFlash, x, y, z, ALLOW_REPLACE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ShouldStay ())
|
||||
{
|
||||
if (PickupFlash != NULL)
|
||||
{
|
||||
Spawn(PickupFlash, x, y, z, ALLOW_REPLACE);
|
||||
}
|
||||
Hide ();
|
||||
if (ShouldRespawn ())
|
||||
{
|
||||
|
|
@ -893,8 +885,13 @@ void AInventory::Touch (AActor *toucher)
|
|||
toucher = toucher->player->mo;
|
||||
}
|
||||
|
||||
if (!CallTryPickup (toucher))
|
||||
return;
|
||||
// This is the only situation when a pickup flash should ever play.
|
||||
if (!CallTryPickup (toucher)) return;
|
||||
|
||||
if (PickupFlash != NULL && !ShouldStay())
|
||||
{
|
||||
Spawn(PickupFlash, x, y, z, ALLOW_REPLACE);
|
||||
}
|
||||
|
||||
if (!(ItemFlags & IF_QUIET))
|
||||
{
|
||||
|
|
@ -1264,7 +1261,7 @@ bool AInventory::CallTryPickup (AActor *toucher)
|
|||
{
|
||||
bool res = TryPickup(toucher);
|
||||
|
||||
if (!res && (ItemFlags & IF_ALWAYSPICKUP))
|
||||
if (!res && (ItemFlags & IF_ALWAYSPICKUP) && !ShouldStay())
|
||||
{
|
||||
res = true;
|
||||
GoAwayAndDie();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue