We were incorrectly comparing an object to a number.
I don't think this will drastically change the AI behaviour as it's
rather an edge case.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D5030
This was SVN commit r27732.
Since 281bb0b2ec, opening the 'Options' menu in-game will show that
there are pending changes, even if the user has done nothing.
Unfortunately the cinematic logic to hide silhouettes, which comes from
cfd08bbf28, is broken following those changes. We use the configuration
to hide them, which results in us, indeed, changing the configuration.
There isn't really a good short term fix. This change only attemps to
reset the setting if we changed it for a cinematic, which fixes the
issue, but has drawbacks.
Ideally, we would use a superior config level, but we need to be careful
about exposing that to JS.
Reported by: langbart
Fixes#6821
Differential Revision: https://code.wildfiregames.com/D5040
This was SVN commit r27730.
The previous code was constructing un-necessary ScriptRequest objects.
Minor optimisation from not entering/leaving realms.
Differential Revision: https://code.wildfiregames.com/D5026
This was SVN commit r27728.
ScriptFunction::Call_ checks HasProperty, but then JS_CallFunctionName
calls GetProperty. This is redundant and can be simplified.
Reviewed By: phosit
Differential Revision: https://code.wildfiregames.com/D5000
This was SVN commit r27726.
Two changes to the vertex pathfinder that should generally improve
performance:
- Sort unaligned edges by distance like we did aligned edges. This
isn't very scientific, but the idea is generally sound, and empirically
it seems to do OK.
- Relax the optimality by using a weighted heuristic, with weight 4/3
or 5/3 depending on the number of obstacles around. In the worst cases,
A* will return paths that are this many times less optimal, but search
should be faster in general (and sometimes much faster).
Both of these optimisations might increase the constant-cost slightly,
but should decrease the worst-case runtimes.
Differential Revision: https://code.wildfiregames.com/D5034
This was SVN commit r27724.
Who says only players should be able to conduct diplomacy?
Also separation of concerns, more maintainable files.
Differential revision: https://code.wildfiregames.com/D4921
Comments by: @elexis, @Stan
Refs. #5894
This was SVN commit r27722.
- remove `SDL_Delay(100)`
- the progress is now an `std::atomic` (not protected by the mutex
anymore)
Based On Patch By: @vladislavbelov
Accepted By: @wraitii
Differential Revision: https://code.wildfiregames.com/D3676
This was SVN commit r27717.
- Add explicit variables for magic values.
- `let`s to `const`.
- Don't start the regen timer when not needed.
Differential revision: https://code.wildfiregames.com/D4965
Comments by: @Stan
This was SVN commit r27707.
Similar trick to D3446 / c87229aa48 - we can short-circuit if we find
units that match our best possible preference.
This is, in particular, almost a 40% wall time improvement on Combat
Demo Huge, but it should apply in a number of more normal cases.
Differential Revision: https://code.wildfiregames.com/D5020
This was SVN commit r27701.