There are two callers for wall_close_door_num. The editor calls it in a
loop for all doors, so copying each active_door is wasteful since none
will survive the end of the loop. Move the copy loop into the caller
that removes elements selectively.
This makes no attempt to fix the bugs associated with changing
Num_open_doors while iterating with Num_open_doors as an upper bound.
Move DXX_VERSION_SEQ from DXXProgram to DXXCommon to make it visible to
DXXArchive.configure_environment(). If pch is enabled, define
DXX_VERSION_SEQ in dxxsconf.h and remove it from the command line. This
fixes a build failure where gcc ignored ownpch.cpp.gch because it was
built without DXX_VERSION_SEQ, but some files were built with
DXX_VERSION_SEQ.
Kreator reported an uninitialized value crash when robots fired homing
weapons. No path assigned a value for track_goal, so it had a default
value of 0 (non-poison builds) or 0xfdfd (poison builds). Assign it a
value of object_none when the created weapon is a homing weapon. Leave
it unassigned for non-homing weapons, since those should never examine
track_goal.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/274>
This code has been #ifdef'd out since 2002, relied on implicit-int in
its declaration (deprecated in C, forbidden in C++), and has been broken
for years due to vms_vector changes. Remove it.
This preserves virtually all game information, including active fire. The saved game 'gamesave.sge' can also be loaded with File->Restore Game State. The level can still be saved as usual (but it warns the user if there's an unsaved game state). This functionality may be useful for testing (or cheating! ;) )
zicodxx reported an assertion failure when powerup duplication was
enabled. Local debugging shows that some levels give preplaced powerups
a movement type of MT_NONE rather than MT_PHYSICS. Such powerups have
undefined data in their mtype.phys_info branch, which confuses the
physics simulation code. Powerups only need MT_PHYSICS to bounce away
from their spawn site. Preplaced powerups never move.
Add assertions that preplaced powerups are MT_NONE. Change the
duplication call to create the duplicates with movement MT_NONE.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/268>
Some gauges views show the current Omega_charge even when the player
does not have an Omega cannon. Initialize Omega_charge to 0 if the
Omega cannon is not granted.
Various points in the game code call `hide_menus()`, then later use
`show_menus()` to reverse the effect. If the forcibly hidden window is
deleted before `show_menus()` is called, the attempt to show it would
write to freed memory. Add a hook to forget those windows when they are
deleted, so that `show_menus()` does not try to make them visible later.
`obj_get_signature()` examines all objects with a type other than
`OBJ_NONE` to find an unused signature.
`load_game_data()`->`read_object()` set an object's type before calling
`obj_get_signature()`, so `obj_get_signature()` would consider the
uninitialized signature of the newly loaded object for exclusion.
Reorder the initialization to compute the signature before the object is
given a type, then store the signature on the object after the poison
bytes (if any) are written.
Commit 1c8ad24 removed all reads of `wind`, but did not remove its
assignment or declaration. This breaks the build with gcc due to
-Wunused-but-set-variable.
Fixes: 1c8ad24da3 ("Check for window_event_result::deleted for ui_get_filename polling loop")