diff --git a/source/core/maptypes.h b/source/core/maptypes.h index b30048766..faf664fd1 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -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. diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 663b23aa7..9f72726be 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -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; } } diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index fd260e7d4..ca3688550 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -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; } }