Mako88 reports that using `-pilot Mixed` on Windows causes crashes
during multiplayer setup, but `-pilot mixed` does not crash. This is
not reproducible on case sensitive filesystems, probably because case
sensitive systems recognize that `Mixed.plr` and `mixed.plr` are not the
same file. In both cases, the underlying plr file name was all
lowercase. Coerce the pilot name to lowercase when it is converted to a
plr file name. This also fixes a minor bug where the check for a
user-specified extension of `.plr` would recognize `-pilot alice.plr`,
but not recognize `-pilot alice.PLR`.
This is a workaround for a bug in the network code, which becomes
confused and crashes when the player's callsign contains mixed case.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/188>
Callers are expected to filter out invalid numbers. Even if they do
not, the only use of the number is to match entries in Stuck_objects.
An invalid match could cause a call to vobjptr() with an invalid index,
but that would be diagnosed by the valptridx checking, so no invalid
memory access will occur.
Many callers of kill_stuck_objects call it twice, once for each of two
walls. Move the flush_fcd_cache up to occur only once, rather than once
per wall.
After fixing the bogus lifeleft assignment, the D2 version is equivalent
to a more thorough version of the D1 version. Delete the D1 version and
use the D2 version for both games.
This assignment looks bogus. If the signature saved when the object
became stuck is different from the signature of the object currently
using that slot, then remove_obsolete_stuck_objects kills the object
using that slot. Signatures are defined to change when the object slot
is freed and reused. Therefore, this statement kills the new object
that took the slot of the obsolete object. This new object may be
important, such as a spawned robot or a weapon.
GCC std::array uses std::size_t for its size_type. On Linux/amd64,
`std::size_t` is `unsigned long`. On Win32, `std::size_t` is
`unsigned int`. This provokes format string warnings because an
unsigned int is passed where the format string declares an unsigned
long. On Win32, `unsigned int` and `unsigned long` are the same size,
so `unsigned long` could have been used to avoid this problem by
maintaining consistency with Linux, but it was not. This may have been
an attempt to achieve bug compatibility with Microsoft's types.
Add a workaround by defining a macro DXX_PRI_size_type in the style of
inttypes.h PRI* macros. Use an SConf test to determine the correct
value by inspecting which compilation runs succeed. Currently, Linux
needs "l", Win32 needs "", and Win64 needs "I64".
Some tests may benefit from the results of earlier tests. Other tests
may give different results if the macros from earlier tests are defined.
SCons dependency checking rejects including dxxsconf.h during testing,
so save the results of self._check_macro and insert them into later
tests. Some tests define their macros in other ways. The macros from
those tests and are not yet inserted.