From 59d932b972e405f33b7341098580e5ded0a3916c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Oct 2009 14:54:29 +0000 Subject: [PATCH] - Fixed some GCC warnings. - fixed: The BossCube could be blocked by floors and ceiling resulting in incorrect movement. I changed it so that A_BrainSpit now sets the MF5_NOINTERACTION flag for anything it spawns that has the MF_NOCLIP flag. For travelling cubes active collision detection makes no sense and only causes problems. This should also make the boss brain work in the other games which previously were excluded by a game mode check in the movement code. - fixed: ACS's GetUserVariable did not work for the script activator. - fixed: Moving floors could be blocked by 2 actors without MF2_PASSMOBJ overlapping each other (common mapping bug, check Herian 2 MAP30.) SVN r1891 (trunk) --- docs/rh-log.txt | 13 +++++++++++++ src/dthinker.cpp | 2 +- src/g_doom/a_bossbrain.cpp | 4 ++++ src/g_shared/a_decals.cpp | 6 +++--- src/p_acs.cpp | 6 ++++-- src/p_map.cpp | 14 ++++++++++++++ src/p_mobj.cpp | 10 ++++++---- 7 files changed, 45 insertions(+), 10 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4faa65303..f309fde3b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,16 @@ +October 1, 2009 (Changes by Graf Zahl) +- Fixed some GCC warnings. +- fixed: The BossCube could be blocked by floors and ceiling resulting + in incorrect movement. I changed it so that A_BrainSpit now sets the + MF5_NOINTERACTION flag for anything it spawns that has the MF_NOCLIP + flag. For travelling cubes active collision detection makes no sense + and only causes problems. This should also make the boss brain + work in the other games which previously were excluded by a game mode + check in the movement code. +- fixed: ACS's GetUserVariable did not work for the script activator. +- fixed: Moving floors could be blocked by 2 actors without MF2_PASSMOBJ + overlapping each other (common mapping bug, check Herian 2 MAP30.) + September 30, 2009 (Changes by Graf Zahl) - Fixed: Coordinate handling for multipatch texture compositing was not correct for true color. Instead of using a clipping rectangle on the destination it diff --git a/src/dthinker.cpp b/src/dthinker.cpp index d7df8abc3..3074aca99 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -203,7 +203,7 @@ void DThinker::SerializeAll(FArchive &arc, bool hubLoad) // before the crash - which is not the case with all other options. //DestroyAllThinkers(); - I_FatalError(err.GetMessage()); + I_FatalError("%s", err.GetMessage()); throw; } bSerialOverride = false; diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 7764f2ecd..47374e617 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -103,6 +103,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit) // spawn brain missile spit = P_SpawnMissile (self, targ, spawntype); + // Boss cubes should move freely to their destination so it's + // probably best to disable all collision detection for them. + if (spit->flags & MF_NOCLIP) spit->flags5 |= MF5_NOINTERACTION; + if (spit != NULL) { spit->target = targ; diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index 77c036ba8..d8620f2dc 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -357,7 +357,7 @@ fixed_t DBaseDecal::GetRealZ (const side_t *wall) const void DBaseDecal::CalcFracPos (side_t *wall, fixed_t x, fixed_t y) { - line_t *line = line = wall->linedef; + line_t *line = wall->linedef; vertex_t *v1, *v2; if (line->sidedef[0] == wall) @@ -390,7 +390,7 @@ void DBaseDecal::CalcFracPos (side_t *wall, fixed_t x, fixed_t y) static void GetWallStuff (side_t *wall, vertex_t *&v1, fixed_t &ldx, fixed_t &ldy) { - line_t *line = line = wall->linedef; + line_t *line = wall->linedef; if (line->sidedef[0] == wall) { v1 = line->v1; @@ -412,7 +412,7 @@ static fixed_t Length (fixed_t dx, fixed_t dy) static side_t *NextWall (const side_t *wall) { - line_t *line = line = wall->linedef;; + line_t *line = wall->linedef; if (line->sidedef[0] == wall) { diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 3f24ad0ed..456c5553b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3118,12 +3118,14 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) } case ACSF_GetUserVariable: + { if (args[1] >= 0 && args[1] < 10) { - activator = SingleActorFromTID(args[0], NULL); - return activator != NULL? activator->uservar[args[1]] : 0; + AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL); + return a != NULL? a->uservar[args[1]] : 0; } else return 0; + } default: diff --git a/src/p_map.cpp b/src/p_map.cpp index 09dbf076b..8bd38498c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4323,6 +4323,13 @@ void P_FindAboveIntersectors (AActor *actor) { // Don't clip against self continue; } + if (!((thing->flags2 | actor->flags2) & MF2_PASSMOBJ) && !((thing->flags3 | actor->flags3) & MF3_ISMONSTER)) + { + // Don't bother if both things don't have MF2_PASSMOBJ set and aren't monsters. + // These things would always block each other which in nearly every situation is + // not what is wanted here. + continue; + } if (thing->z >= actor->z && thing->z <= actor->z + actor->height) { // Thing intersects above the base @@ -4365,6 +4372,13 @@ void P_FindBelowIntersectors (AActor *actor) { // Don't clip against self continue; } + if (!((thing->flags2 | actor->flags2) & MF2_PASSMOBJ) && !((thing->flags3 | actor->flags3) & MF3_ISMONSTER)) + { + // Don't bother if both things don't have MF2_PASSMOBJ set and aren't monsters. + // These things would always block each other which in nearly every situation is + // not what is wanted here. + continue; + } if (thing->z + thing->height <= actor->z + actor->height && thing->z + thing->height > actor->z) { // Thing intersects below the base diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 7d2f4c58d..3cb95148e 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -2177,8 +2177,10 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) // teleported the actor so it is no longer below the floor. if (mo->z <= mo->floorz) { - if ((mo->flags & MF_MISSILE) && - (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) + // old code for boss cube disabled + //if ((mo->flags & MF_MISSILE) && (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) + + if (mo->flags & MF_MISSILE) { mo->z = mo->floorz; if (mo->BounceFlags & BOUNCE_Floors) @@ -2289,8 +2291,8 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) } if (mo->velz > 0) mo->velz = 0; - if (mo->flags & MF_MISSILE && - (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) + if (mo->flags & MF_MISSILE) + //&& (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) { if (mo->flags3 & MF3_CEILINGHUGGER) {