- the remaining cansee calls

This commit is contained in:
Christoph Oelckers 2022-08-22 18:41:05 +02:00
parent db0ce36143
commit f35c610328
4 changed files with 7 additions and 16 deletions

View file

@ -124,18 +124,13 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i
DExhumedActor* FindFood(DExhumedActor* pActor)
{
auto pSector = pActor->sector();
int x = pActor->int_pos().X;
int y = pActor->int_pos().Y;
int z = pActor->int_pos().Z;
int z2 = (z + pSector->int_ceilingz()) / 2;
if (nChunkTotal)
if (nChunkTotal)
{
DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal];
if (pActor2 != nullptr)
{
if (cansee(x, y, z2, pSector, pActor2->int_pos().X, pActor2->int_pos().Y, pActor2->int_pos().Z, pActor2->sector())) {
if (cansee(pActor->spr.pos.plusZ(pSector->ceilingz * 0.5), pSector, pActor2->spr.pos, pActor2->sector())) {
return pActor2;
}
}
@ -150,7 +145,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
{
if (nPlayerPic == pActor2->spr.picnum)
{
if (cansee(x, y, z, pSector, pActor2->int_pos().X, pActor2->int_pos().Y, pActor2->int_pos().Z, pActor2->sector())) {
if (cansee(pActor->spr.pos, pSector, pActor2->spr.pos, pActor2->sector())) {
return pActor2;
}
}

View file

@ -1641,13 +1641,9 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) ||
cansee(pRadialActor->int_pos().X,
pRadialActor->int_pos().Y,
pRadialActor->int_pos().Z - 512,
cansee(pRadialActor->spr.pos.plusZ(-2),
pRadialActor->sector(),
pActor->int_pos().X,
pActor->int_pos().Y,
pActor->int_pos().Z - 8192,
pActor->spr.pos.plusZ(-32),
pActor->sector()))
{
edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius;

View file

@ -765,7 +765,7 @@ void BossHealthMeter(void)
DSWActor* actor = BossSpriteNum[i];
if (actor != nullptr && !bosswasseen[i])
{
if (cansee(actor->int_pos().X, actor->int_pos().Y, int_ActorZOfTop(actor), actor->sector(), pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z - Z(40), pp->cursector))
if (cansee(DVector3(actor->spr.pos.XY(), ActorZOfTop(actor)), actor->sector(), pp->pos.plusZ(-40), pp->cursector))
{
if (i == 0 && !bosswasseen[0])
{

View file

@ -166,7 +166,7 @@ bool CanSeeWallMove(DSWActor* caller, int match)
{
found = true;
if (cansee(caller->int_pos().X, caller->int_pos().Y, caller->int_pos().Z, caller->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector()))
if (cansee(caller->spr.pos, caller->sector(), actor->spr.pos, actor->sector()))
{
return true;
}