This could be a shared variable instead, since it cannot be directly
influenced by gameplay. However, it is influenced by the game mode, and
keeping shared variables that are mode-specific would be more complexity
for very little savings.
Zico's commit 38fabd7c49 open-coded a test for a robot smart mine. So
far, this is the only place it is needed, but others might arise. Move
the test and its comment out to a static helper function.
As documented in zico's commit 38fabd7c49, robot smart mines have a
different ID number than player smart mines. Rename the test functions
to clarify that they only recognize player smart mines, but not robot
smart mines.
git grep -l is_proximity_bomb_or_smart_mine | xargs sed -i -e 's/is_proximity_bomb_or_smart_mine/is_proximity_bomb_or_player_smart_mine/g'
clang-check warns that if `N_bitmaps <= 1`, then
`DiskBitmapHeader_d1_read` will never run, but `bmh.wh_extra` will be
read in `bitmap_read_d1`. Reorder the logic to return early if there
are no bitmaps.
clang-check warns about a potential binding a reference to nullptr in
the case that a segment has 0 sides. While this is silly and
impossible, a related failure mode would occur if vm_vec_dot never
indicated a side as good. This should be impossible, but the test for
nullptr is cheap, so add it to silence the checker.
The game has an alternative level file format that is not normally used.
This format can enable seismic events on a timer, independent of reactor
countdown or earthshaker usage. However, this feature is not reset on
loading a regular level after playing a level with the timer-driven
seismic events, so the regular level shakes according to the timer, even
though its author never designed it to do so.
Fix that by resetting the timer state to 0 before loading a regular
level.
Level seismic events and Earthshaker seismic events start with different
intensities, but share everything afterward. Move the common parts to a
function.
When Next_seismic_sound_time is non-zero, a seismic sound is playing.
When Next_seismic_sound_time is zero, no sound is playing. Use this to
eliminate the explicit tracking variable Seismic_sound_playing.