Remove the multi_do_fire branches that check the message type. Delegate
those checks to the caller, so that multi_do_fire can work with the
common initial sequence of the three messages.
Descent 2 secret levels allow a player to rescue hostages that are not
counted in `total_hostages`, so a player can exit with more hostages
saved than were in the mine. Change the scoring logic not to penalize a
player for saving these unaccounted hostages.
In non-memory-poison builds, the zero initialization of the new object
will suffice to cover this. In memory-poison builds, the new object
will be reset to a poison value, so the member must be given a
reasonable value here.
This is only used in the file where it is defined, so it can be inlined
even though the definition is not in a header. Enabling inlining
encourages gcc to see that the `operator new`/`operator delete` calls
are not mismatched.
clang-14 is detected as being able to optimize out unreachable paths,
but then triggers a build error reporting an unspecified invalid use
somewhere in multi.cpp.
Remove the static check, and rely on -Wsuggest-attribute=noreturn to
report any functions which are guaranteed to fail. This is a weaker
check, but over the course of development, the static check has been hit
rarely, if ever, so keeping it provides little value.
```
In file included from similar/main/multi.cpp:38:
In file included from common/main/game.h:32:
In file included from common/main/robot.h:34:
In file included from common/main/object.h:40:
common/include/valptridx.h:229:2: error: call to unsigned int valptridx<dcx::player>::check_index_range_size<valptridx<dcx::player>::index_range_exception, std::__1::less>(char const*, unsigned int, unsigned long, valptridx<dcx::player>::array_managed_type const*)::DXX_ALWAYS_ERROR_FUNCTION::dxx_trap_handle_index_range_error() declared with 'error' attribute: invalid index used in array subscript
DXX_VALPTRIDX_CHECK(Compare<std::size_t>()(s, array_size), handle_index_range_error, "invalid index used in array subscript", a, s);
^
common/include/valptridx.h:37:3: note: expanded from macro 'DXX_VALPTRIDX_CHECK'
DXX_VALPTRIDX_STATIC_CHECK(dxx_valptridx_check_success_condition, dxx_trap_##ERROR, FAILURE_STRING); \
^
common/include/valptridx.h:20:5: note: expanded from macro 'DXX_VALPTRIDX_STATIC_CHECK'
(DXX_ALWAYS_ERROR_FUNCTION(FAILURE_FUNCTION, FAILURE_STRING), 0) \
^
build/ulinux-clang++-14-64b10d04-ogl/dxxsconf.h:84:2: note: expanded from macro 'DXX_ALWAYS_ERROR_FUNCTION'
DXX_ALWAYS_ERROR_FUNCTION::F(); \
^
1 error generated.
```
Given this code:
```
enum class X : unsigned;
X a{1};
```
gdb has an unfortunate behavior of reporting "incomplete type" and
refusing to show the underlying value of `a`, even when `a` is in scope.
Adding `enum class X : unsigned {}` fixes this and allows gdb to show
the value.
Convert the RAIIsocket to a simple SOCKET before passing it to FD_SET.
Otherwise, the build fails with:
```
similar/main/net_udp.cpp: In function 'int {anonymous}::udp_general_packet_ready(dcx::{anonymous}::RAIIsocket&)':
similar/main/net_udp.cpp:969:2: error: use of deleted function 'bool dcx::{anonymous}::RAIIsocket::operator==(T) const [with T = long long unsigned int]'
969 | FD_SET(sock, &set);
| ^~~~~~
similar/main/net_udp.cpp:493:29: note: declared here
493 | template <typename T> bool operator==(T) const = delete;
| ^~~~~~~~
```
The kill messages have different lengths and conditional processing
based on whether the message is MULTI_KILL_CLIENT or MULTI_KILL_HOST.
Split the two into separate functions to simplify the implementation of
each.