Commit 829e95b6 meant to remove the restriction that the game not be
hoard mode, but incorrectly also removed the restriction that the game
be multiplayer. Restore the multiplayer restriction.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/433>
Fixes: 829e95b6f8 ("Separate hoard/proximity tracking")
This removes the need to walk all objects when creating a new one, since
each object can have a private generation counter, unaware of other
objects. For compatibility with demos, mix in the object's index when
writing the signature value.
`init_new_page` calls `load_briefing_screen` with the a pointer to
`br->background_name`, which causes a strncpy of the form
```
strncpy(X, X, N);
```
Valgrind warns for this overlap. The copy is useless in that case, so
skip it.
A prior change switched to using the greater, rather than the lesser, of
`16` or `Countdown_seconds_left`, which increased the rotation from the
ship rocking effect. Switch back to use the lesser value.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/431>
Fixes: 644d6fa513 ("Simplify do_countdown_frame ship rocking effect")
This was requested by a user in early 2018. However, the proposed
prototype was susceptible to various forms of desynchronization, and was
unsuitable for merging. No further revisions were proposed, and the
feature languished. This commit enables the guidebot in cooperative
games and addresses the known synchronization problems, as well as some
other bugs that were uncovered during light testing. This is classified
as an experimental feature because it has not been heavily tested in
complicated games.
Requested-by: cfeuersaenger <https://github.com/dxx-rebirth/dxx-rebirth/issues/364>
`make_nearby_robot_snipe` computed the `robot_info` of every `object` in the
area before checking whether those `object`s were of type `OBJ_ROBOT`. This
is wrong, but usually harmless since it checked the type before using
the resulting `robot_info`. Starting in commit 9f26e2211, this triggered
a warning whenever `make_nearby_robot_snipe` checked nearby non-robot
`object`s.
Rewrite the tests to check for type `OBJ_ROBOT` before reading the
`object`'s id.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/429>
Fixes: 9f26e2211e ("Warn on invalid object ID access")
Commit 9898d13 fixed a crash on long filenames, but also tried to
optimize the Destination Saturn hack. However, this optimization was
implemented incorrectly, and caused the game to read only the
Destination Saturn highest_level entry when playing the First Strike
campaign, rather than using the greater level of Destination Saturn or
First Strike.
Restore the old logic, but restrict it to D1X. D2X never used an empty
string for the First Strike campaign, so this logic could not trigger
there, which is also how the bug was missed in initial testing.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/428>
Fixes: 9898d136f1 ("Fix fortification crash loading missions with long filenames")
In multiplayer, the host sends a destroy message for both sides of the
wall. `do_exploding_wall_frame` processes both, but
`num_exploding_walls` is only decreased by 1, causing an assertion
failure at the end. Remove the assertion, since the wall does not
explode instantly on join, despite being marked as WALL_EXPLODING.
PhysFS 3.0 tests whether archive members are directories, but treats a
symbolic link that points to a directory as distinct from the underlying
directory, even when symlink following is enabled. As a result, if
$D2X_REBIRTH_HOME/missions is a symlink to a directory, then it is
ignored and no missions are available. In PhysFS 2.0, the link was
followed and the missions were available.
Add a trailing dot to the path, which already has a trailing slash, to
force PhysFS to consider the underlying directory, not the link.
If register_compile_target=0, `self.builddir` on DXXProgram was used but
not set.
```
AttributeError: 'D1XProgram' object has no attribute 'builddir':
File "/s/SConstruct", line 5263:
main(register_program)
File "/s/SConstruct", line 5218:
''.join(['%s:\n%s' % (d.program_message_prefix, d.init(substenv)) for d in dxx])
File "/s/SConstruct", line 4853:
self.register_program()
File "/s/SConstruct", line 4895:
exe_target = self.builddir.File(exe_target)
```
In one path, load_briefing_screen is called with `br->background_name`
as an input. This caused a call to `snprintf(a, sizeof(a), "%s", a);`,
which is undefined behavior. Switch back to the prior style of
unconditionally declaring a local array, performing filename
manipulation in that array, and copying the array back to
`br->background_name` afterward.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/420>
pkubaj proposed extending the if/elif tree. This patch instead switches
to a loop, which avoids repeating any strings and is cleaner to extend
when another platform shows up needing normalization.
Requested-by: pkubaj <https://github.com/dxx-rebirth/dxx-rebirth/pull/426>
clang treats -Wunused as a request for -Wunused-lambda-capture, which is
good, except that -Wunused-lambda-capture is overzealous. It should
warn for captures that are not used in the body. It should not, but
does, warn for captures which are used in the body when such captures
are not required by the standard. Since 4 of the supported gcc versions
require that capture, removing the capture is not an option at this
point. Add a test to suppress the clang warning in this case, and hope
that eventually clang will warn only for uses that are actually unused.
This removes the need for parts of <https://github.com/dxx-rebirth/dxx-rebirth/pull/426> (by pkubaj).
Remove use of object_guidebot_cannot_reach and instead track the
reachability of the object as a separate flag. This allows the game to
remember when an object was found, but unreachable. Previously, it
would store only that some unreachable object was found. Now, it stores
the index of the unreachable object. This extra information is not used
yet.
Reported-by: Dainslaif <https://github.com/dxx-rebirth/dxx-rebirth/issues/421>
Fixes: c3cead4319 ("Move Escort_goal_index to d_unique_buddy_state")