mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
- 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)
This commit is contained in:
parent
93202a5488
commit
1e554a1fcc
2 changed files with 17 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue