mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- the remaining cansee calls
This commit is contained in:
parent
db0ce36143
commit
f35c610328
4 changed files with 7 additions and 16 deletions
|
@ -124,18 +124,13 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i
|
||||||
DExhumedActor* FindFood(DExhumedActor* pActor)
|
DExhumedActor* FindFood(DExhumedActor* pActor)
|
||||||
{
|
{
|
||||||
auto pSector = pActor->sector();
|
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];
|
DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal];
|
||||||
if (pActor2 != nullptr)
|
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;
|
return pActor2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +145,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
|
||||||
{
|
{
|
||||||
if (nPlayerPic == pActor2->spr.picnum)
|
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;
|
return pActor2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1641,13 +1641,9 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
|
||||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||||
|
|
||||||
if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) ||
|
if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) ||
|
||||||
cansee(pRadialActor->int_pos().X,
|
cansee(pRadialActor->spr.pos.plusZ(-2),
|
||||||
pRadialActor->int_pos().Y,
|
|
||||||
pRadialActor->int_pos().Z - 512,
|
|
||||||
pRadialActor->sector(),
|
pRadialActor->sector(),
|
||||||
pActor->int_pos().X,
|
pActor->spr.pos.plusZ(-32),
|
||||||
pActor->int_pos().Y,
|
|
||||||
pActor->int_pos().Z - 8192,
|
|
||||||
pActor->sector()))
|
pActor->sector()))
|
||||||
{
|
{
|
||||||
edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius;
|
edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius;
|
||||||
|
|
|
@ -765,7 +765,7 @@ void BossHealthMeter(void)
|
||||||
DSWActor* actor = BossSpriteNum[i];
|
DSWActor* actor = BossSpriteNum[i];
|
||||||
if (actor != nullptr && !bosswasseen[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])
|
if (i == 0 && !bosswasseen[0])
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,7 +166,7 @@ bool CanSeeWallMove(DSWActor* caller, int match)
|
||||||
{
|
{
|
||||||
found = true;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue