From 448b8955c547abe29372b857a102a1865203f002 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Jul 2008 19:06:30 +0000 Subject: [PATCH] - Changed: AInventory::Tick now only calls the super method if the item is not owned. Having owned inventory items interact with the world is not supposed to happen. - Fixed: case PCD_SECTORDAMAGE in p_acs.cpp was missing a terminating 'break'. - Fixed: When a weapon is destroyed, its sister weapon must also be destroyed. SVN r1068 (trunk) --- docs/rh-log.txt | 4 ++++ src/g_shared/a_pickups.cpp | 26 +++++++++++++++++++++++++- src/p_acs.cpp | 1 + src/sound/fmodsound.cpp | 2 +- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 727ebb705..5a3351cf2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ July 5, 2008 (Changes by Graf Zahl) +- Changed: AInventory::Tick now only calls the super method if the item is not + owned. Having owned inventory items interact with the world is not supposed + to happen. +- Fixed: case PCD_SECTORDAMAGE in p_acs.cpp was missing a terminating 'break'. - Fixed: When a weapon is destroyed, its sister weapon must also be destroyed. - Added a check for PUFFGETSOWNER to A_BFGSpray. - Moved the PUFFGETSOWNER check into P_SpawnPuff and removed the limitation diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 5c6a8590d..3e00bde64 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -446,7 +446,31 @@ END_DEFAULTS void AInventory::Tick () { - Super::Tick (); + if (Owner == NULL) + { + // AActor::Tick is only handling interaction with the world + // and we don't want that for owned inventory items. + Super::Tick (); + } + else if (tics != -1) // ... but at least we have to advance the states + { + tics--; + + // you can cycle through multiple states in a tic + // [RH] Use <= 0 instead of == 0 so that spawnstates + // of 0 tics work as expected. + if (tics <= 0) + { + assert (state != NULL); + if (state == NULL) + { + Destroy(); + return; + } + if (!SetState (state->GetNextState())) + return; // freed itself + } + } if (DropTime) { if (--DropTime == 0) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index ad0c273f0..606b44704 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5297,6 +5297,7 @@ int DLevelScript::RunScript () } } } + break; case PCD_THINGDAMAGE2: STACK(3) = P_Thing_Damage (STACK(3), activator, STACK(2), FName(FBehavior::StaticLookupString(STACK(1)))); diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index 89db82eaf..5580f3178 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -1693,7 +1693,7 @@ void FMODSoundRenderer::SetSfxPaused(bool paused, int slot) { SFXPaused &= ~(1 << slot); } - Printf("%d\n", SFXPaused); + //Printf("%d\n", SFXPaused); if (oldslots != 0 && SFXPaused == 0) { PausableSfx->setPaused(false);