- Duke: Fix bad setups when calling cansee(). Fixes issues with pigcop on kerb in E2L1.

This commit is contained in:
Mitchell Richters 2022-10-08 22:01:47 +11:00 committed by Christoph Oelckers
parent 113980ca8e
commit b804d7fe15

View file

@ -301,7 +301,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
}
}
int q = -(16 << 8) + (krand() & ((32 << 8) - 1));
double q = zrand(32) - 16;
auto Owner = actor->GetOwner();
for (int x = 0; x < 7; x++)
@ -327,7 +327,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
if (actor->spr.picnum != SHRINKSPARK || (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL))
if (dist(actor, act2) < r)
{
if (badguy(act2) && !cansee(act2->spr.pos.plusZ(q * maptoworld), act2->sector(), actor->spr.pos.plusZ(q * maptoworld), actor->sector()))
if (badguy(act2) && !cansee(act2->spr.pos.plusZ(q), act2->sector(), actor->spr.pos.plusZ(q), actor->sector()))
continue;
fi.checkhitsprite(act2, actor);
}