Skip to content

Commit

Permalink
Fixed bug in calculation of targets' distance for the purposes of det…
Browse files Browse the repository at this point in the history
…ermining whether to fire missile(s).
  • Loading branch information
danij committed Dec 27, 2006
1 parent b772c0c commit 22da0a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/doom64tc/src/p_enemy.c
Expand Up @@ -228,7 +228,7 @@ boolean P_CheckMissileRange(mobj_t *actor)
// OPTIMIZE: get this from a global checksight
dist =
P_ApproxDistance(actor->pos[VX] - actor->target->pos[VX],
actor->pos[VX] - actor->target->pos[VY]) - 64 * FRACUNIT;
actor->pos[VY] - actor->target->pos[VY]) - 64 * FRACUNIT;

if(!actor->info->meleestate)
dist -= 128 * FRACUNIT; // no melee attack, so fire more
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/jdoom/src/p_enemy.c
Expand Up @@ -206,7 +206,7 @@ boolean P_CheckMeleeRange(mobj_t *actor)

boolean P_CheckMissileRange(mobj_t *actor)
{
fixed_t dist;
fixed_t dist;

if(!P_CheckSight(actor, actor->target))
return false;
Expand All @@ -225,7 +225,7 @@ boolean P_CheckMissileRange(mobj_t *actor)
// OPTIMIZE: get this from a global checksight
dist =
P_ApproxDistance(actor->pos[VX] - actor->target->pos[VX],
actor->pos[VX] - actor->target->pos[VY]) - 64 * FRACUNIT;
actor->pos[VY] - actor->target->pos[VY]) - 64 * FRACUNIT;

if(!actor->info->meleestate)
dist -= 128 * FRACUNIT; // no melee attack, so fire more
Expand Down Expand Up @@ -1616,7 +1616,7 @@ void C_DECL A_Fall(mobj_t *actor)
{
// actor is on ground, it can be walked over
actor->flags &= ~MF_SOLID;

#ifdef _DEBUG
Con_Message("A_Fall: actor not solid any more\n");
#endif
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/wolftc/src/p_enemy.c
Expand Up @@ -225,7 +225,7 @@ boolean P_CheckMissileRange(mobj_t *actor)
// OPTIMIZE: get this from a global checksight
dist =
P_ApproxDistance(actor->pos[VX] - actor->target->pos[VX],
actor->pos[VX] - actor->target->pos[VY]) - 64 * FRACUNIT;
actor->pos[VY] - actor->target->pos[VY]) - 64 * FRACUNIT;

if(!actor->info->meleestate)
dist -= 128 * FRACUNIT; // no melee attack, so fire more
Expand Down

0 comments on commit 22da0a5

Please sign in to comment.