dxx-rebirth/similar/main
Kp f79f6ab1cc Make switches invulnerable to blast_nearby_glass
`blast_nearby_glass` calls `check_effect_blowup`, but ignores the result.
If `check_effect_blowup` executes a blow-up effect, and the blown object
is a switch, the return value will instruct the caller to execute the
associated trigger.  Since `blast_nearby_glass` ignores the return
value, it never executes a trigger.  This was originally masked by a bug
that passed undefined data from `blast_nearby_glass` to
`check_effect_blowup`, which usually confused `check_effect_blowup` into
treating the explosion as not originating from the player.  This
confusion then forced an early return when a switch was hit, effectively
accidentally making switches invulnerable to `blast_nearby_glass`.
Commit f6352e7 fixed the data confusion, allowing `check_effect_blowup`
to recognize that the explosion came from a player's weapon.  However,
it did not add handling for the trigger, so now `blast_nearby_glass` can
destroy the switch without activating the trigger.  This is at the least
annoying, and in some levels may make progress impossible.  There are
two ways to resolve this:

- Fix the logic to always execute the switch when the switch is
  destroyed, whether by direct hit or by `blast_nearby_glass`.
- Restore the quirk that switches are invulnerable to
  `blast_nearby_glass`.

Conveniently, the `force_blowup_flag` is set by `blast_nearby_glass` and
clear for all other callers, so it can be used to recognize that the
caller will not handle the switch.  Use this to implement choice 2.

Even with this change, a direct hit by a missile can still destroy a
switch and activate its trigger, since that is handled through
`collide_weapon_and_wall`.  Thus, players can still use the technique of
using a guided missile to activate an otherwise impossible switch.

Fixes: f6352e7957 ("Pass correct object to check_effect_blowup")
Reported-by: wm4 <https://github.com/dxx-rebirth/dxx-rebirth/issues/419>
2019-05-11 20:18:29 +00:00
..
ai.cpp Use enumerate() to iterate some MAX_SIDES_PER_SEGMENT loops 2019-05-04 18:27:37 +00:00
aipath.cpp Use enumerate() to iterate some MAX_SIDES_PER_SEGMENT loops 2019-05-04 18:27:37 +00:00
automap.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
bm.cpp Use xrange for loops with zero start and simple identifier end 2019-05-04 18:27:37 +00:00
bmread.cpp Use xrange for loops with zero start and simple identifier end 2019-05-04 18:27:37 +00:00
cntrlcen.cpp Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
collide.cpp Make switches invulnerable to blast_nearby_glass 2019-05-11 20:18:29 +00:00
config.cpp Make ADL MIDI runtime configurable 2018-10-18 02:18:56 +00:00
console.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
controls.cpp Rename ObjectState to LevelUniqueObjectState for consistency 2018-12-30 00:43:57 +00:00
credits.cpp Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
digiobj.cpp Use unsigned in more prototypes 2019-03-03 00:31:09 +00:00
dumpmine.cpp Use enumerate() to iterate some MAX_SIDES_PER_SEGMENT loops 2019-05-04 18:27:37 +00:00
effects.cpp Move Effects to d_level_unique_effects_clip_state 2019-03-03 00:31:09 +00:00
endlevel.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
fireball.cpp Track headlights in d_level_unique_light_state 2019-04-13 18:00:07 +00:00
fuelcen.cpp Move Num_robot_centers to d_level_shared_robotcenter_state 2019-03-12 04:01:07 +00:00
fvi.cpp Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
game.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
gamecntl.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
gamefont.cpp Enforce separation of font X/Y scaling 2018-06-08 04:04:05 +00:00
gamemine.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
gamerend.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
gamesave.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
gameseg.cpp Remove __attribute__((packed)) on shortpos for gcc-9 support 2019-05-11 20:18:29 +00:00
gameseq.cpp Add range helper zip() 2019-05-04 18:27:36 +00:00
gauges.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
generate-kconfig-udlr.py
hostage.cpp Track headlights in d_level_unique_light_state 2019-04-13 18:00:07 +00:00
hud.cpp Rename ObjectState to LevelUniqueObjectState for consistency 2018-12-30 00:43:57 +00:00
iff.cpp
inferno.cpp Fix sharepath confusion when building both targets 2019-01-20 05:36:56 +00:00
kconfig.cpp Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
kconfig.ui-table.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
kmatrix.cpp Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
laser.cpp Move spreadfire,helix orientation to player_info 2019-05-04 18:27:36 +00:00
lighting.cpp Use xrange for render loops 2019-05-04 18:27:37 +00:00
menu.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
mglobal.cpp Track headlights in d_level_unique_light_state 2019-04-13 18:00:07 +00:00
mission.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
morph.cpp Use xrange for loops with zero start and simple identifier end 2019-05-04 18:27:37 +00:00
multi.cpp Remove __attribute__((packed)) on shortpos for gcc-9 support 2019-05-11 20:18:29 +00:00
multibot.cpp Use check_untrusted on boss robot messages 2019-04-28 00:53:40 +00:00
net_udp.cpp Open advanced sub-menus as submenus 2019-03-10 18:48:40 +00:00
newdemo.cpp Remove __attribute__((packed)) on shortpos for gcc-9 support 2019-05-11 20:18:29 +00:00
newmenu.cpp Enable -Wimplicit-fallthrough=5; fix resulting breaks 2019-04-04 04:29:03 +00:00
object.cpp Use xrange for loops with zero start and simple identifier end 2019-05-04 18:27:37 +00:00
paging.cpp Move Effects to d_level_unique_effects_clip_state 2019-03-03 00:31:09 +00:00
physics.cpp Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
piggy.cpp Fix various gcc-9 -Wformat-truncation warnings 2019-05-06 00:36:16 +00:00
player.cpp Switch most in-tree http:// links to https:// 2018-09-02 00:57:29 +00:00
playsave.cpp Use xrange for loops with constant numerical start and simple identifier end 2019-05-04 18:27:37 +00:00
polyobj.cpp Fix Descent 1 laser color 2019-03-20 03:57:15 +00:00
powerup.cpp Move Escort_goal_object to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
render.cpp Use xrange for render loops 2019-05-04 18:27:37 +00:00
robot.cpp Move robot_create out of line 2019-03-03 00:31:09 +00:00
scores.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
segment.cpp Switch most in-tree http:// links to https:// 2018-09-02 00:57:29 +00:00
slew.cpp Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
songs.cpp Fix sdlmixer=0 build of songs.cpp 2018-07-30 00:49:59 +00:00
state.cpp Use xrange for loops with zero start and constant numerical end 2019-05-04 18:27:36 +00:00
switch.cpp Use unsigned in more prototypes 2019-03-03 00:31:09 +00:00
terrain.cpp Move Viewer_eye to local scope 2018-12-30 00:43:57 +00:00
texmerge.cpp
text.cpp
titles.cpp Fix gcc-9 -Wstringop-truncation in titles.cpp 2019-05-11 20:18:29 +00:00
vclip.cpp Track headlights in d_level_unique_light_state 2019-04-13 18:00:07 +00:00
vers_id.cpp Switch most in-tree http:// links to https:// 2018-09-02 00:57:29 +00:00
wall.cpp Use enumerate() to iterate some MAX_SIDES_PER_SEGMENT loops 2019-05-04 18:27:37 +00:00
weapon.cpp Move Buddy_objnum to d_unique_buddy_state 2019-03-03 00:31:08 +00:00