mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- SpriteOverlap
This commit is contained in:
parent
2c4862b220
commit
f8eac8c8eb
4 changed files with 11 additions and 11 deletions
|
@ -571,7 +571,7 @@ int DoEelMove(DSWActor* actor)
|
|||
|
||||
ASSERT(u->Rot != nullptr);
|
||||
|
||||
if (SpriteOverlap(actor->GetSpriteIndex(), u->targetActor->GetSpriteIndex()))
|
||||
if (SpriteOverlap(actor, u->targetActor))
|
||||
NewStateGroup(actor, u->ActorActionSet->CloseAttack[0]);
|
||||
|
||||
if (TEST(u->Flags,SPR_SLIDING))
|
||||
|
|
|
@ -4596,12 +4596,12 @@ int NewStateGroup(DSWActor* actor, STATEp StateGroup[])
|
|||
}
|
||||
|
||||
|
||||
bool SpriteOverlap(int16_t spritenum_a, int16_t spritenum_b)
|
||||
bool SpriteOverlap(DSWActor* actor_a, DSWActor* actor_b)
|
||||
{
|
||||
SPRITEp spa = &sprite[spritenum_a], spb = &sprite[spritenum_b];
|
||||
SPRITEp spa = &actor_a->s(), spb = &actor_b->s();
|
||||
|
||||
USERp ua = User[spritenum_a].Data();
|
||||
USERp ub = User[spritenum_b].Data();
|
||||
USERp ua = actor_a->u();
|
||||
USERp ub = actor_b->u();
|
||||
|
||||
int spa_tos, spa_bos, spb_tos, spb_bos, overlap_z;
|
||||
|
||||
|
@ -5507,7 +5507,7 @@ DoGet(DSWActor* actor)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!SpriteOverlap(actor->GetSpriteIndex(), pp->Actor()->GetSpriteIndex()))
|
||||
if (!SpriteOverlap(actor, pp->Actor()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ void SpriteFindNewDirection(short SpriteNum, short range);
|
|||
int DoWalk(short SpriteNum);
|
||||
int DoBody(short SpriteNum);
|
||||
bool CanMoveHere(int16_t spritenum);
|
||||
bool SpriteOverlap(int16_t spritenum_a, int16_t spritenum_b);
|
||||
bool SpriteOverlap(DSWActor*, DSWActor*);
|
||||
int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath);
|
||||
void SpriteControl(void);
|
||||
void DoActorZrange(DSWActor*);
|
||||
|
|
|
@ -7346,7 +7346,7 @@ int DoDamageTest(DSWActor* actor)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (GetOwner(actor) != itActor && SpriteOverlap(actor->GetSpriteIndex(), itActor->GetSpriteIndex()))
|
||||
if (GetOwner(actor) != itActor && SpriteOverlap(actor, itActor))
|
||||
{
|
||||
DoDamage(itActor->GetSpriteIndex(), actor->GetSpriteIndex());
|
||||
}
|
||||
|
@ -7428,7 +7428,7 @@ int DoFlamesDamageTest(DSWActor* actor)
|
|||
DoDamage(itActor->GetSpriteIndex(), actor->GetSpriteIndex());
|
||||
}
|
||||
}
|
||||
else if (SpriteOverlap(actor->GetSpriteIndex(), itActor->GetSpriteIndex()))
|
||||
else if (SpriteOverlap(actor, itActor))
|
||||
{
|
||||
DoDamage(itActor->GetSpriteIndex(), actor->GetSpriteIndex());
|
||||
}
|
||||
|
@ -7708,7 +7708,7 @@ int DoMineExpMine(DSWActor* actor)
|
|||
|
||||
// Explosions are spherical, not planes, so let's check that way, well cylindrical at least.
|
||||
zdist = abs(sp->z - wp->z)>>4;
|
||||
if (SpriteOverlap(actor->GetSpriteIndex(), itActor->GetSpriteIndex()) || (unsigned)zdist < wu->Radius + u->Radius)
|
||||
if (SpriteOverlap(actor, itActor) || (unsigned)zdist < wu->Radius + u->Radius)
|
||||
{
|
||||
DoDamage(itActor->GetSpriteIndex(), actor->GetSpriteIndex());
|
||||
// only explode one mine at a time
|
||||
|
@ -14964,7 +14964,7 @@ int DoStaticFlamesDamage(DSWActor* actor)
|
|||
if (dist > 2000)
|
||||
continue;
|
||||
|
||||
if (SpriteOverlap(actor->GetSpriteIndex(), itActor->GetSpriteIndex())) // If sprites are overlapping, cansee will fail!
|
||||
if (SpriteOverlap(actor, itActor)) // If sprites are overlapping, cansee will fail!
|
||||
DoDamage(itActor->GetSpriteIndex(), actor->GetSpriteIndex());
|
||||
else if (u->Radius > 200)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue