From e4cfc374bec02c9ffff27e93bb838173b8f5ce7c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 19 Jan 2022 09:02:20 +0100 Subject: [PATCH] - another trip bomb flag. --- source/games/duke/src/constants.h | 1 + source/games/duke/src/flags_d.cpp | 1 + source/games/duke/src/player_d.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index d1702329c..b0570b3c1 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -324,6 +324,7 @@ enum sflags_t SFLAG_CHECKSLEEP = 0x08000000, SFLAG_NOTELEPORT = 0x10000000, SFLAG_SE24_REMOVE = 0x20000000, + SFLAG_BLOCK_TRIPBOMB = 0x40000000, }; diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index 8a12ed222..452d524e9 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -209,6 +209,7 @@ void initactorflags_d() setflag(SFLAG_NOTELEPORT, { TRANSPORTERSTAR, TRANSPORTERBEAM, TRIPBOMB, BULLETHOLE, WATERSPLASH2, BURNING, BURNING2, FIRE, FIRE2, TOILETWATER, LASERLINE }); setflag(SFLAG_SE24_NOCARRY, { TRIPBOMB, LASERLINE, BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, SIDEBOLT1, SIDEBOLT1 + 1, SIDEBOLT1 + 2, SIDEBOLT1 + 3, CRANE, CRANE1, CRANE2, BARBROKE }); setflag(SFLAG_SE24_REMOVE, { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, FOOTPRINTS4, BULLETHOLE, BLOODSPLAT1, BLOODSPLAT2, BLOODSPLAT3, BLOODSPLAT4 }); + setflag(SFLAG_BLOCK_TRIPBOMB, { TRIPBOMB }); // making this a flag adds the option to let other things block placing trip bombs as well. if (isWorldTour()) { diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index db3291053..17271e441 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2031,7 +2031,7 @@ int operateTripbomb(int snum) DukeSectIterator it(hit.hitSector); while ((act = it.Next())) { - if (act->spr.picnum == TRIPBOMB && + if (!actorflag(act, SFLAG_BLOCK_TRIPBOMB) && abs(act->spr.pos.Z - hit.hitpos.Z) < (12 << 8) && ((act->spr.pos.X - hit.hitpos.X) * (act->spr.pos.X - hit.hitpos.X) + (act->spr.pos.Y - hit.hitpos.Y) * (act->spr.pos.Y - hit.hitpos.Y)) < (290 * 290)) return 0; }