Fixes: 435aa5a020 ("Move USE_UDP to dxxsconf.h; rename to DXX_USE_UDP")
Fixes: 7c8c2b5aa4 ("Move USE_TRACKER to dxxsconf.h; rename to DXX_USE_TRACKER")
Saved games dump robot ai_local state for all objects, regardless of
whether the object is a robot. Loading a game restored all ai_local
values, regardless of whether the object was a robot on restore. This
caused memory corruption in objects that were not robots when the
`ctype.`_T_ for that object was large enough to overlap
`ctype.ai_info.ail`.
Fix this by loading the ai_local into a junk buffer when the object is
not a robot. It would be better to skip over the bogus ai_local
entirely, but the structure of ai_local_read_swap makes that difficult.
Use the easy fix for now.
Kreator reports that "Pyramids of Luxoran" crashes due to a valptridx
sanity check. The level incorrectly attempts to open a wall on a
segment/side which has no wall.
Add an error check and a con_printf suggesting that the level author
needs to fix the invalid trigger.
Kreator reports that a level from back when Descent was new fails the
test for bogus matcen triggers. This level cannot be played when that
test throws an exception, so downgrade the exception to a CON_URGENT
message. This will hopefully deter level authors from creating any new
levels with this problem, but will allow users to play existing levels.
escort_get_goal_segment expected exists_in_mine to return object_none or
a valid object. In some mines, exists_in_mine will return
object_guidebot_cannot_reach, which is neither object_none nor a valid
object. Exclude reading the segment of the unreachable object.
Allow dcx::UI_DIALOG struct to be subclassed step 3. This step adds the destructor and makes sure the dialog is only deleted within the main dialog handler if the specific handler didn't return window_event_result::deleted.
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
Allow dcx::UI_DIALOG struct to be subclassed step 1. This step renames and reconfigures untyped_ui_dialog_create in dialog.cpp to be the main constructor. Also adds a template constructor that allows an event handler that takes a subclass of UI_DIALOG.
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
Allow dcx::window struct to be subclassed step 2. This step renames and reconfigures window_create in window.cpp to be the main constructor. Also add a template constructor that allows an event handler that takes a subclass of window.
Allow dcx::window struct to be subclassed step 1. This step moves the definition for the window struct into window.h, keeping all member variables private and declaring the window related functions as 'friends'. This avoids changes to source files that use the window struct at this stage. Also moving some of the simpler functions in window.cpp into the struct definition to inline them. I would prefer to use class methods, so changing some of these to class methods as well.