From 1e554a1fcc5b244deb3ff5920e9cfb708784136c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 2 Aug 2009 03:56:03 +0000 Subject: [PATCH] - Restored the reactiontime countdown for A_SpawnFly, since some Dehacked mod could conceivable rely on it. The deadline is now kept in special2 and used in preference as long as it is non-zero. SVN r1744 (trunk) --- docs/rh-log.txt | 3 +++ src/g_doom/a_bossbrain.cpp | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ab6dfb600..30e01edac 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ August 1, 2009 +- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked + mod could conceivable rely on it. The deadline is now kept in special2 + and used in preference as long as it is non-zero. - Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the issues that caused its inclusion. Is an optimized GCC build any faster for being able to use strict aliasing rules? I dunno. It's still slower diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index a763e3cbf..9d68858f4 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -111,18 +111,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit) // if the target had the same y coordinate as the spitter. if ((spit->velx | spit->vely) == 0) { - spit->reactiontime = 0; + spit->special2 = 0; } else if (abs(spit->vely) > abs(spit->velx)) { - spit->reactiontime = (targ->y - self->y) / spit->vely; + spit->special2 = (targ->y - self->y) / spit->vely; } else { - spit->reactiontime = (targ->x - self->x) / spit->velx; + spit->special2 = (targ->x - self->x) / spit->velx; } // [GZ] Calculates when the projectile will have reached destination - spit->reactiontime += level.maptime; + spit->special2 += level.maptime; } if (!isdefault) @@ -145,8 +145,16 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound) int r; // [GZ] Should be more viable than a countdown... - if (self->reactiontime == 0 || self->reactiontime > level.maptime) - return; // still flying + if (self->special2 != 0) + { + if (self->special2 > level.maptime) + return; // still flying + } + else + { + if (self->reactiontime == 0 || --self->reactiontime != 0) + return; // still flying + } targ = self->target;