mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 01:11:30 +00:00
- little bit of cleanup on Duke's bullet hole code.
This commit is contained in:
parent
8d84bc2599
commit
ecb2732629
3 changed files with 10 additions and 7 deletions
|
@ -169,6 +169,7 @@ enum ESpriteBits2
|
|||
CSTAT2_SPRITE_NOFIND = 1, // Invisible to neartag and hitscan
|
||||
CSTAT2_SPRITE_MAPPED = 2, // sprite was mapped for automap
|
||||
CSTAT2_SPRITE_NOSHADOW = 4, // cast no shadow.
|
||||
CSTAT2_SPRITE_DECAL = 8, // always attached to a wall.
|
||||
};
|
||||
|
||||
// tsprite flags use the otherwise unused clipdist field.
|
||||
|
|
|
@ -499,7 +499,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeSectIterator it(hit.hitWall->nextSector());
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->spr.statnum == 3 && l->spr.lotag == 13)
|
||||
if (l->spr.statnum == STAT_EFFECTOR && l->spr.lotag == SE_13_EXPLOSIVE)
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
}
|
||||
|
@ -518,6 +518,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
auto delta = hit.hitWall->delta();
|
||||
hole->spr.ang = getangle(-delta.X, -delta.Y) + 512;
|
||||
ssp(hole, CLIPMASK0);
|
||||
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeSectIterator it(hit.hitWall->nextSector());
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->spr.statnum == 3 && l->spr.lotag == 13)
|
||||
if (l->spr.statnum == STAT_EFFECTOR && l->spr.lotag == SE_13_EXPLOSIVE)
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
}
|
||||
|
@ -407,13 +407,14 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
if (dist(l, spark) < (12 + (krand() & 7)))
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
auto l = spawn(spark, BULLETHOLE);
|
||||
if (l)
|
||||
auto hole = spawn(spark, BULLETHOLE);
|
||||
if (hole)
|
||||
{
|
||||
l->spr.xvel = -1;
|
||||
hole->spr.xvel = -1;
|
||||
auto delta = hit.hitWall->delta();
|
||||
l->spr.ang = getangle(-delta.X, -delta.Y) + 512;
|
||||
ssp(l, CLIPMASK0);
|
||||
hole->spr.ang = getangle(-delta.X, -delta.Y) + 512;
|
||||
ssp(hole, CLIPMASK0);
|
||||
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue