Compiler error messages are generally better when reporting a misuse
that fails a requires() versus reporting a misuse that fails a
std::enable_if. In some cases, this also makes the code clearer, and
avoids the need for dummy template parameters as a place to invoke
std::enable_if.
The caller has the player object, and can provide the orientation matrix
from it. Use that instead of letting multi_send_fire recompute the
object in order to get the matrix.
When the player fires a generic secondary, the choice of proximity bomb
versus super-mine is never read. When the player specifically drops a
bomb, only that choice needs to be read. Pass the chosen weapon as an
argument, and avoid computing the choice on the path where it is never
read.
Two paths are always local. One path is always remote. Split the
handler function to remove the locality test and rely on the caller's
knowledge of whether the affected player is local.
Resolve the object to a vmobjptridx once, and use it as needed. Replace
some uses of ConsoleObject with the local player, since those should be
the same, and local player is already computed.
Only one caller passes a value other than `object_none` for
`is_bomb_objnum`. That one caller uses an equivalent predicate to the
one that `multi_send_fire` uses for deciding whether to use
`MULTI_FIRE_BOMB`. Therefore, if `is_bomb_objnum != object_none` is
true, the weapon is guaranteed to be a proximity bomb or smart mine, and
`multi_send_fire` can use `MULTI_FIRE_BOMB` without retesting the object
id.
Commit 81dd23b151 ("Only charge player for weapons that fire successfully")
added an early return when `objnum == object_none`, so if execution
reaches the call to `multi_send_fire`, then the object is guaranteed to
exist. Access the track_goal without rechecking whether the object
exists.
Instead of sliding the entire queue down one element at a time, move the
non-expired elements in one step, and wipe all the trailing elements
in a single pass.
The only values for any given player are true/false, so use a bitset
instead of a byte per player. Some implementations may use a uint64_t
internally, negating the space savings. Even so, this version is
an improvement for requiring the use of playernum_t as an index.