mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- HitBreakSprite
This commit is contained in:
parent
aa13619087
commit
a69a45523f
3 changed files with 18 additions and 25 deletions
|
@ -1015,17 +1015,11 @@ bool NullActor(DSWActor* actor)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int HitBreakSprite(short BreakSprite, short type)
|
int HitBreakSprite(DSWActor* breakActor, short type)
|
||||||
{
|
{
|
||||||
auto breakActor = &swActors[BreakSprite];
|
|
||||||
SPRITEp bp = &breakActor->s();
|
SPRITEp bp = &breakActor->s();
|
||||||
USERp bu = breakActor->u();
|
USERp bu = breakActor->u();
|
||||||
|
|
||||||
//SPRITEp sp;
|
|
||||||
// ignore as a breakable if true
|
|
||||||
//if (sp->lotag == TAG_SPRITE_HIT_MATCH)
|
|
||||||
// return(false);
|
|
||||||
|
|
||||||
if (TEST_BOOL1(bp))
|
if (TEST_BOOL1(bp))
|
||||||
{
|
{
|
||||||
if (TEST_BOOL2(bp))
|
if (TEST_BOOL2(bp))
|
||||||
|
|
|
@ -2591,7 +2591,7 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
|
||||||
|
|
||||||
if (testpointinquad(sp->x, sp->y, x, y))
|
if (testpointinquad(sp->x, sp->y, x, y))
|
||||||
{
|
{
|
||||||
if (TEST(sp->extra, SPRX_BREAKABLE) && HitBreakSprite(actor->GetSpriteIndex(),0))
|
if (TEST(sp->extra, SPRX_BREAKABLE) && HitBreakSprite(actor, 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (sp->statnum == STAT_MISSILE)
|
if (sp->statnum == STAT_MISSILE)
|
||||||
|
|
|
@ -4360,7 +4360,7 @@ VehicleMoveHit(short SpriteNum)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hit_sprite, u->ID);
|
HitBreakSprite(&swActors[hit_sprite], u->ID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4531,7 +4531,7 @@ WeaponMoveHit(short SpriteNum)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hit_sprite, u->ID);
|
HitBreakSprite(&swActors[hit_sprite], u->ID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7794,11 +7794,11 @@ int DoExpDamageTest(DSWActor* actor)
|
||||||
// Breakable stuff
|
// Breakable stuff
|
||||||
for (stat = 0; stat < max_stat; stat++)
|
for (stat = 0; stat < max_stat; stat++)
|
||||||
{
|
{
|
||||||
StatIterator it(StatBreakList[stat]);
|
SWStatIterator it(StatBreakList[stat]);
|
||||||
while ((i = it.NextIndex()) >= 0)
|
while (auto itActor = it.Next())
|
||||||
{
|
{
|
||||||
sp = &sprite[i];
|
sp = &itActor->s();
|
||||||
u = User[i].Data();
|
u = itActor->u();
|
||||||
|
|
||||||
DISTANCE(sp->x, sp->y, wp->x, wp->y, dist, tx, ty, tmin);
|
DISTANCE(sp->x, sp->y, wp->x, wp->y, dist, tx, ty, tmin);
|
||||||
if ((unsigned)dist > wu->Radius)
|
if ((unsigned)dist > wu->Radius)
|
||||||
|
@ -7813,7 +7813,7 @@ int DoExpDamageTest(DSWActor* actor)
|
||||||
|
|
||||||
if (TEST(sp->extra, SPRX_BREAKABLE))
|
if (TEST(sp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(i, wu->ID);
|
HitBreakSprite(itActor, wu->ID);
|
||||||
break_count++;
|
break_count++;
|
||||||
if (break_count > 6)
|
if (break_count > 6)
|
||||||
break;
|
break;
|
||||||
|
@ -10814,8 +10814,7 @@ void SpawnFireballFlames(int16_t SpriteNum, int16_t enemy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int SpawnBreakFlames(DSWActor* actor)
|
||||||
SpawnBreakFlames(DSWActor* actor)
|
|
||||||
{
|
{
|
||||||
SPRITEp sp = &actor->s();
|
SPRITEp sp = &actor->s();
|
||||||
USERp u = actor->u();
|
USERp u = actor->u();
|
||||||
|
@ -13438,7 +13437,7 @@ InitSwordAttack(PLAYERp pp)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -13629,7 +13628,7 @@ InitFistAttack(PLAYERp pp)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -14523,7 +14522,7 @@ int ContinueHitscan(PLAYERp pp, short sectnum, int x, int y, int z, short ang, i
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14697,7 +14696,7 @@ InitShotgun(PLAYERp pp)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17549,7 +17548,7 @@ InitUzi(PLAYERp pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE) && HitBreakSprite(hitinfo.sprite,0))
|
if (TEST(hsp->extra, SPRX_BREAKABLE) && HitBreakSprite(&swActors[hitinfo.sprite],0))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -17728,7 +17727,7 @@ InitEMP(PLAYERp pp)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
//return(0);
|
//return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18239,7 +18238,7 @@ InitSobjMachineGun(short SpriteNum, PLAYERp pp)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18674,7 +18673,7 @@ InitTurretMgun(SECTOR_OBJECTp sop)
|
||||||
|
|
||||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||||
{
|
{
|
||||||
HitBreakSprite(hitinfo.sprite,0);
|
HitBreakSprite(&swActors[hitinfo.sprite],0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue