1
0
forked from 0ad/0ad
Commit Graph

6247 Commits

Author SHA1 Message Date
87a93b2498 Add version command line option. Fixes #2965.
This was SVN commit r17611.
2016-01-08 19:35:33 +00:00
1cc1ba2b17 Fix non-visual replaymode. Refs #3301 (cinematic camera). Patch by Vladislav. Bug reported by eternaf.
This was SVN commit r17606.
2016-01-06 21:40:59 +00:00
b18cd3254c Test FixedVector{2,3}D script conversions, and test calling functions of the prototypes.
Also ENSURE that the given value identifier is actually present in the
cache instead of creating one if it is not.

This was SVN commit r17603.
2016-01-04 21:41:40 +00:00
ab4668ac79 Remove legacy error codes from strings.
This was SVN commit r17600.
2016-01-04 17:58:28 +00:00
7a3f011587 Fix a typo.
This was SVN commit r17599.
2016-01-04 17:05:43 +00:00
5033fd6cbf Some const and fix the indentation.
This was SVN commit r17598.
2016-01-04 17:05:39 +00:00
89aef0b6eb Cinematic camera core functionality. Patch by Vladislav Belov.
Based on existing code that was still around from an old(not working)
implementation.
Supports basic control from trigger scirpts (queue, start and stop
camera paths) and works in multiplayer.

This was SVN commit r17594.
2016-01-03 12:41:04 +00:00
d313a1934a Code style cleanups for CinemaPath in preparation for the cinematic camera patch.
Refs #3301

This was SVN commit r17593.
2016-01-02 20:14:14 +00:00
036f985017 Add missing semicolons.
Update timestamp.

This was SVN commit r17591.
2016-01-02 18:12:02 +00:00
d5d60d53ed Replace JS_ASSERT (which is renamed to MOZ_ASSERT in SpiderMonkey 38) with TS_ASSERT, since the former was used for no apparent reason.
This was SVN commit r17588.
2016-01-01 21:28:25 +00:00
9281aaf25e Map more specific messages from the Gloox documentation to registration results and stanza errors in the lobby code. Also, don't request translation of more arcane errors. Fixes #3047
This was SVN commit r17587.
2016-01-01 18:38:50 +00:00
371a41c216 seems that line was missing, with the result that garrisoned units sent a TerritoryPositionChanged message each turn
This was SVN commit r17586.
2016-01-01 17:45:53 +00:00
9f9db45a03 Fix broken feedback display logic and broken error handling from ccb534259d. Additionally, streamline logic in prelobby.js and remove an unexplained check in lobby.js added by 76a1a84a58.
This was SVN commit r17584.
2016-01-01 17:18:17 +00:00
ccb534259d Major lobby cleanup.
Create an object holding the handling of all netmessage types.
Display private messages sent by moderators.

Details:
 Switch back the second and third argument of CreateSimpleMessage, so it
relates again to the switch/object.
 Reduce the dimension/nesting of the object/switch from three to two.
 Hence remove the useless "standard" and "internal" value send in the
text field.
 Rename CreateSimpleMessage to CreateGUIMessage
 Use the property "level" instead of "text" for "connect" and
"disconnect".
 Remove the handling of the "connect" event in lobby.js, since it is
never called.
 Translate the disconnect event.
 Add comments and explicit checks to handleMessage and handleMUCMessage
to make obvious where they differ.
 Remove the "message" property from those GUI messages, since it should
just use "text".
 Move the login-fail handling to JS.
 Remove useless sprintf calls from warning messages.
 Inline some variables.
 Add missing semicolons.

This was SVN commit r17581.
2015-12-31 17:08:23 +00:00
a144ec7e08 Indentation corrections and other code style fixes in preparation for the cinematic camera patch.
Refs #3301

This was SVN commit r17578.
2015-12-31 13:40:56 +00:00
f7a262fa4a Remove trailing whitespace. Based on patch by otero, refs #3268.
This was SVN commit r17576.
2015-12-31 11:45:13 +00:00
8d9cfd66b8 Reorganize code in different files in prepartion for the cinematic camera patch (by Vladislav Belov).
Refs #3301

This was SVN commit r17575.
2015-12-30 21:16:35 +00:00
969008befd Add shebang to ease running the script as a program.
Update replay command adding needed -mod=public.

This was SVN commit r17574.
2015-12-30 14:29:28 +00:00
36c08193ba optimizes range queries, fixes #3717
This was SVN commit r17573.
2015-12-30 13:44:51 +00:00
9f65e90b60 Fix wrong errormessage in case of encountering a broken replay.
This was SVN commit r17567.
2015-12-29 14:00:30 +00:00
543472b77b Optimization of isBoxVisible + cleanup, fixes #3712
This was SVN commit r17561.
2015-12-28 16:27:31 +00:00
82c215de49 prevent thousands of calls per turn of calculeTerritories which would exit immediately
This was SVN commit r17560.
2015-12-28 16:23:06 +00:00
3fd4d07ca1 Test \0 in object property names for serializing.
This was SVN commit r17539.
2015-12-22 19:01:18 +00:00
6970ebba16 Test non-ASCII string conversions.
This was SVN commit r17535.
2015-12-22 17:30:05 +00:00
848efb56b3 Make a method const.
This was SVN commit r17527.
2015-12-22 14:08:32 +00:00
b790403c87 Strip trailing whitespace from network code.
This was SVN commit r17524.
2015-12-21 13:58:32 +00:00
509028d738 CompileOptions::setFileAndLine does not copy the string, so create a copy for it.
This was SVN commit r17512.
2015-12-19 02:55:30 +00:00
332096e4ed SpiderMonkey 38 removes JS_AllocateArrayBufferContents.
Users required the returned buffer to be passable to free(), so replace
it by malloc().
https://bugzilla.mozilla.org/show_bug.cgi?id=1037358

This was SVN commit r17511.
2015-12-19 02:49:46 +00:00
190f9176df SpiderMonkey 38 removes JS_NewPropertyIterator, use JS_Enumerate instead.
https://bugzilla.mozilla.org/show_bug.cgi?id=1081660

This was SVN commit r17510.
2015-12-19 02:21:22 +00:00
753936e7df SpiderMonkey 38 removes JS_Evaluate{,UC}Script, use JS::Evaluate.
https://bugzilla.mozilla.org/show_bug.cgi?id=1100579

This was SVN commit r17508.
2015-12-19 01:58:03 +00:00
2239fe338c The jschar typedef is removed in SpiderMonkey 38.
Since it already is char16_t in 31 replace it by that.
https://bugzilla.mozilla.org/show_bug.cgi?id=1063962

This was SVN commit r17506.
2015-12-19 01:29:55 +00:00
69ab2bae5b Some ctors were made explicit in SpiderMonkey 38, so call them where needed.
https://bugzilla.mozilla.org/show_bug.cgi?id=1013663

This was SVN commit r17505.
2015-12-19 01:13:56 +00:00
efda359acc Use new when calling the builtin typed array constructor.
The current code will be forbidden in ES6.

This was SVN commit r17504.
2015-12-19 01:10:13 +00:00
9cf9695d8d Graceful exit in case of trying to replay a directory. Fixes #3427.
Also remove unneeded variable ran_atlas.

This was SVN commit r17501.
2015-12-18 21:16:08 +00:00
abce6cb737 Pathfinder optimization, fixes #3541.
Simplify the math of Geometry::TestRayAASquare.

This was SVN commit r17500.
2015-12-18 15:05:33 +00:00
c1b97e4709 Improve indentation of 'case' statements updated after SDL1 removal (thanks leper).
Also update other 'case' statements in the same file for consistency.

This was SVN commit r17491.
2015-12-16 15:36:56 +00:00
5a7c2ec2db Cleanup after SDL1 removal.
Remove the "sdl1" option from premake4.lua (thanks historic_bruno).
Improve isUnprintableChar indentation, resolve two defines, change SDL*
to SDL2 in premake (thanks leper).

This was SVN commit r17479.
2015-12-15 08:53:24 +00:00
9a2d0f803e Remove disabled by default SDL1 support.
Refs #2041.

This was SVN commit r17470.
2015-12-14 10:52:21 +00:00
1e504cd64c Fix the actoreditor menu bar on OSX. Patch by trompetin17. Fixes #1554.
This was SVN commit r17458.
2015-12-13 16:53:35 +00:00
909b8d4369 Allow multiple special sprites, to facilitate cases where we want to add an overlay to a sprite.
"color" can make use of the sprite's alpha texture, and the "add_color"
effect will now take the original image's alpha into account.
Remove the no longer needed "unaffordableMask" images on a variety of
panels.

Somewhat based on a patch by BoeseRaupe. Fixes #2421 and #3688.

This was SVN commit r17456.
2015-12-13 16:03:17 +00:00
a74d9be130 make const the new method introduced in 2451872731
This was SVN commit r17425.
2015-12-10 19:23:50 +00:00
b6dbb2bff0 fix tabs of 2451872731
This was SVN commit r17415.
2015-12-09 20:56:53 +00:00
2451872731 improve performance of hierarchical pathfinder, refs #3588
This was SVN commit r17413.
2015-12-09 19:56:30 +00:00
73a26a22ca Enable by default postproc, smoothlos and all water features when on OpenGL4+.
This autodetection has a higer priority than default.cfg, but lower
priority than local changes.
Note that after enabling these features some get disabled later on on
some drivers (Intel, software renderers).
Also note that mesa drivers only expose core profile OpenGL, and 0 A.D.
reads compatibility profile, so that on mesa drivers OpenGL4 is never
detected and these features are never enabled by default.

This was SVN commit r17412.
2015-12-09 16:12:58 +00:00
a5152c14d1 Properly use the passed parameter as all other occourences.
Fixes 'disable_allwater = false' case in hwdetect.js.

This was SVN commit r17410.
2015-12-09 11:28:24 +00:00
6a73dc2e16 fix multiple (useless) insertion in grid update of hierarchical pathfinder
This was SVN commit r17409.
2015-12-08 22:58:04 +00:00
fd32da5c87 Update tinygettext.
Updates tinygettext to upstream commit
328f015d0b07465c8a5a05cbfc0a41154a2f8ebf.
This adds better collision logging.

This was SVN commit r17405.
2015-12-08 18:05:11 +00:00
780a1de136 Don't comment out code. Refs #3486.
This was SVN commit r17400.
2015-12-07 12:27:52 +00:00
8af675e207 Don't emit sounds when selecting dead animals. Patch by Stan. Fixes #3486.
This was SVN commit r17399.
2015-12-07 00:21:24 +00:00
987a7028bd Implements relative templates. Fixes #2936. Thanks to leper, wraitii, historicbruno and everyone else that helped.
This was SVN commit r17386.
2015-12-05 17:02:25 +00:00
71b0d9c052 Update atlas with the new map_sizes.json format. Refs #3355.
This was SVN commit r17379.
2015-12-04 16:37:30 +00:00
2e69872b11 Remove debug parser from replay menu. Refs #3440
This was SVN commit r17367.
2015-12-03 03:12:43 +00:00
5b2738b0cb Doubles size of sound card string buffers, for users with many sound devices present. Fixes #3660
This was SVN commit r17365.
2015-12-02 22:41:17 +00:00
02c065e2c9 Removes the unused "gone" presence state from the lobby. Refs #3383.
This was SVN commit r17358.
2015-12-02 14:41:32 +00:00
a1e57aaeaf Replay menu cleanups. Fixes #3440.
Hides the summary-button in the replaymenu in case the summary wasn't
saved.
Corrects the timestamp for incompatible replays.
Remove unused UNUSED from header files.
Use string8() instead of OsString().
Mention a reported compiler warning.
Use const& instead of a copy in StartVisualReplay().

This was SVN commit r17356.
2015-12-02 13:53:44 +00:00
0a8fc4bb08 improve pathFinder by optimizing the DistanceToSquare computation, refs #3588
This was SVN commit r17350.
2015-12-01 19:01:41 +00:00
418318ea88 Properly read preferglsl in user config files.
This was SVN commit r17347.
2015-12-01 09:00:12 +00:00
6f09803e8c TerrainTextureManager file loading rewrite. Fixes #3358.
Add directory callback to vfs::ForEachFile.
Each terrain directory should now have a terrains.xml file,
as using the previous terrains.xml file is unlikely to be what was
intended.

This was SVN commit r17341.
2015-11-30 20:12:12 +00:00
fa9c8e061b Enable GLSL by default on OpenGL 3+.
This doesn't override any user setting, it just changes the default when
no preferglsl setting is specified.

Fixes #3641.
Refs #145.

This was SVN commit r17338.
2015-11-30 10:51:02 +00:00
700859b2c3 Move the playerdefaults to the settings directory. Refs #3355
This was SVN commit r17332.
2015-11-30 01:33:59 +00:00
61e5e92b14 Update/revamp my template analyzer tool.
Remove the useless "fancy" data in favor of a simpler visualization of
templates, adding an in-place tool to filter and sort (for convenience).

This was SVN commit r17331.
2015-11-29 19:19:20 +00:00
814cdd9524 Tie tangent generation with preferGLSL setting for convenience since that setting was not really useful. Fixes #2506 . Patch by fabio.
This was SVN commit r17325.
2015-11-29 15:44:22 +00:00
7de746cc58 Visual replay code cleanup. Refs #3440.
Moves StartVisualReplay() from JSInterface_VisualReplay.cpp to
VisualReplay.cpp, so that the former doesn't define any logic.
Uses replayFile.string8() instead of
utf8_from_wstring(replayFile.string()).
SAFE_DELETE instead of delete.
Fixes a compiler warning in getReplayDuration().

This was SVN commit r17314.
2015-11-29 00:23:18 +00:00
be9b6fa59c improves performance of hierarchical pathFinder, refs #3588
This was SVN commit r17310.
2015-11-28 13:06:44 +00:00
432df9b38e Use two range based for loops to fix two TODOs.
This was SVN commit r17303.
2015-11-28 08:27:42 +00:00
9a40d1284e Update version numbers. Switch lobby room.
This was SVN commit r17299.
2015-11-28 08:27:33 +00:00
082af749f0 Actually remove all unlisted translations.
This was SVN commit r17298.
2015-11-21 20:00:20 +00:00
229e850dba Fix a compiler warning.
This was SVN commit r17296.
2015-11-20 20:42:45 +00:00
fc6af83c2a cleanup 5b335442fb
This was SVN commit r17294.
2015-11-20 19:47:08 +00:00
5b335442fb fix a bug in the HierarchicalPathfinder revealed by changes in 9b0ed97d05, patch by wraitii
This was SVN commit r17293.
2015-11-20 19:45:48 +00:00
ee8f9516eb Update translations to be included in the release.
This was SVN commit r17290.
2015-11-19 23:09:49 +00:00
0b2da13dea never edit a patch before commiting !
This was SVN commit r17287.
2015-11-19 22:17:00 +00:00
9b0ed97d05 fixes and performance improvements in hierarchical pathfinder, fixes #3621
This was SVN commit r17284.
2015-11-19 22:02:25 +00:00
9e35f7d68b The over-rasterization of obstructions introduced in [17161] could in very rare cases lead to an OOS in the passability grid. Fixes #3612.
This was SVN commit r17278.
2015-11-16 22:03:10 +00:00
9819b23529 I should not commit half-finished debug code.
This was SVN commit r17276.
2015-11-16 18:48:05 +00:00
70164a02c4 Handle double-clicks on list elements better. Patch by elexis.
Fixes #3574

This was SVN commit r17274.
2015-11-16 18:23:21 +00:00
39f572af88 Stop processing turns after a replay finishes. Patch by elexis. Fixes #3581
The animations continue because we currently have no easy way to stop
interpolating. My suggestion would be to implement a network
synchronised pause and use something like that.

This was SVN commit r17265.
2015-11-15 15:08:46 +00:00
6b8dc7684a Return in case we do not have any available JS timer slots instead of accessing OOB memory.
This was SVN commit r17263.
2015-11-15 01:09:35 +00:00
f1f0fa1f8f Fix a typo. Thanks stan for noticing.
This was SVN commit r17260.
2015-11-14 21:46:05 +00:00
3760891131 Fix the precedent fix. It turns out the code behaves in much weirder ways than I expected.
This was SVN commit r17255.
2015-11-14 19:03:20 +00:00
e7fb75a680 Initialize new variables correctly.
This was SVN commit r17247.
2015-11-12 23:07:54 +00:00
e9271025dc Forgot to serialize a new unitMotion variable, resulting in OOS on rejoin.
This was SVN commit r17245.
2015-11-12 20:57:50 +00:00
9357cce112 Math is hard
This was SVN commit r17242.
2015-11-12 17:32:33 +00:00
3febc387d5 Styling fixes.
This was SVN commit r17241.
2015-11-12 17:23:50 +00:00
52443dfe80 Fix an erroneous ENSURE in PatchRData and move it where it will be very slightly clearer. Fixes #3598
This was SVN commit r17240.
2015-11-12 17:22:44 +00:00
913545aa41 Mark several CFixedVector2D as const and passed by reference in Geometry and a few other places. Mark some functions (that probably already were) inline.
Also make sure we don't include Geometry.h where it's not necessary.

This was SVN commit r17238.
2015-11-11 20:50:02 +00:00
f3b22e51a3 Optimize Geometry::PointIsInSquare, which is used quite often in performance hotspots.
Original patch by mimo. Refs #3588

This was SVN commit r17236.
2015-11-11 20:02:47 +00:00
a138bed96b Fix an issue where units did not notice other moving units with my latest commits.
This was SVN commit r17234.
2015-11-11 19:06:07 +00:00
cc199c4cca Fix a critical typo in the last commit and a debug message left in accidentally. Thanks fabio.
This was SVN commit r17232.
2015-11-11 13:55:36 +00:00
06cb37ff74 Add PlanNextStep back to the unitMotion, in a completely different version. This basically anticipates where we'll probably move next, and checks if static units might block us. Makes paths look slightly better.
This was SVN commit r17229.
2015-11-11 13:29:06 +00:00
607955489d Check if units are in the world in UnitRenderer::PickAllEntitiesAtPoint. Probably fixes #3587, though I'm not sure as it proved unreproducible.
This was SVN commit r17228.
2015-11-11 13:27:13 +00:00
3b13fb7608 Improve unitMotion behavior. When a unit's path is obstructed, it will now try shortpathing around an increasingly large search range, to optimize behavior in trivial cases where it just needs to go around a unit.
Also stop trying too hard when we are close to the destination and our
only order is to move there.
This should result in a slight optimization of the behavior, as well as
slightly more sanity overall.

This was SVN commit r17226.
2015-11-11 12:49:24 +00:00
3ddd72c1a4 Fix a rare case where units might get stuck around other idle entities, and clarify a related comment.
Refs #3471

This was SVN commit r17225.
2015-11-11 12:28:38 +00:00
c42160ec10 Fix an issue where units could not go around large obstructions when short-pathing as it ran in the search-space "walls", reported by gamebot. Fixes #3593.
This is also a very slight optimization.

This was SVN commit r17224.
2015-11-11 12:23:11 +00:00
2f6f0bd477 Serialize everything that is needed by UpdateVisibilityData instead of assuming everything as dirty.
Fixes #3271.

This was SVN commit r17223.
2015-11-11 12:15:57 +00:00
32da740f14 Allow kicking/banning players from gamesetup and session. Patch by elexis. Fixes #3241.
This was SVN commit r17217.
2015-11-11 02:05:23 +00:00
d3ff090ce7 Fix an OOS issue where, on ownership change, units affected by speed-modifying technologies did not update their speed.
This was SVN commit r17215.
2015-11-10 23:31:06 +00:00
51ec6f4728 improve function RasterizeRectWithClearance, about 40% faster, ref #3588
This was SVN commit r17212.
2015-11-09 21:16:46 +00:00
0ba9fa1cc1 Optimize RasterizeRectWithClearance slightly further. Thanks mimo for noticing.
This was SVN commit r17209.
2015-11-08 18:08:49 +00:00
313d324fac Fix some cases of unit "dancing". Thanks to Elexis for nagging me.
This was SVN commit r17208.
2015-11-08 17:55:23 +00:00
fe040c695f Change the shape rasterization to not use DistanceToSquare, which often called sqrt. This apparently reduces total turn time by as much as 5% (!)
Refs #3368

This was SVN commit r17207.
2015-11-08 17:24:59 +00:00
cb025bb725 Removes extraneous check from XpartaMuPP. Fixes #3568.
This was SVN commit r17206.
2015-11-08 17:09:59 +00:00
dd6d09521c Not sure how but I messed up the previous commit.
This was SVN commit r17205.
2015-11-08 16:44:08 +00:00
42d0e6d46e Optimize the hierarchical pathfinder's "makeGoalReachable" slightly. Does not affect simulation results.
This was SVN commit r17204.
2015-11-08 16:39:43 +00:00
cd025b2069 fix typo
This was SVN commit r17203.
2015-11-08 13:09:49 +00:00
c319ff062d Partial fix to a formation "gliding" issue, unsure so far what is causing this.
This was SVN commit r17198.
2015-11-07 17:36:31 +00:00
3163c9d4a2 Fix a rare issue with the short-range pathfinder where units took odd paths when the target was beyond the search zone.
This was SVN commit r17197.
2015-11-07 14:33:55 +00:00
2d7074e8d6 Fix unused variables left behind.
This was SVN commit r17194.
2015-11-06 20:42:12 +00:00
596025df71 Fix a bug in [17163] that could get units with a large passability class stuck.
This was SVN commit r17192.
2015-11-06 20:33:13 +00:00
e26b59c917 Changes to unitMotion.
Make sure we do not treat as circles entities that we really should
treat as squares (such as trees). This fixes an issue reported by Stan.
Make sure we never forget about our destination if we are blocked by
unit obstructions. This makes sure that units in a group but not in
formation will not be blocked by the other units, and probably makes the
general behavior more sane. Helps following [17166]

Refs #3505, #3471, #3376

This was SVN commit r17191.
2015-11-06 20:09:18 +00:00
9efd79e240 Fix an issue where square diagonals were incorrectly handled when checking the distance to the target. Fixes #3577 properly. Patch by mimo.
Decrease fishing ship gathering range in consequence (revert [17178]).

This was SVN commit r17190.
2015-11-06 19:56:52 +00:00
1ed3761859 Fix style issues and redundant code in [17161] and [17163].
This was SVN commit r17189.
2015-11-06 19:48:08 +00:00
2126b53b9d Fixes interpolation of flying objects.
This was SVN commit r17187.
2015-11-06 16:56:39 +00:00
83bba7bdfc revert e0771b98dd which was based on misunderstanding of the algo, and fix the inverted_circle case, refs #3577
This was SVN commit r17184.
2015-11-05 19:22:04 +00:00
05547bf36f Fix an oversight.
This was SVN commit r17182.
2015-11-05 16:52:19 +00:00
a9323da01b Fix #3566 by fixing an off-by-one error in the final replay turn logic. Patch by elexis.
This was SVN commit r17180.
2015-11-04 20:33:34 +00:00
8f1853b8d8 Prevent accidental overwriting of replays in very rare cases while we wait for a better solution.
Refs #3255

This was SVN commit r17177.
2015-11-04 19:26:40 +00:00
f91478c730 Fix an oversight in the obstruction manager that lead to possibly the most insidious OOS error we've seen so far.
Fixes #3292 .

This was SVN commit r17176.
2015-11-04 18:51:47 +00:00
e527a5c321 Fix #3525 and #3399 by recalculating territories on request to GetTerritoryPercentage. Patch by elexis
This was SVN commit r17171.
2015-11-02 07:32:43 +00:00
6493974800 Fix #2676 by only acknowledging commands matching the sender's name if cheats are disabled. Based on patch by historic_bruno.
This was SVN commit r17170.
2015-11-02 03:20:44 +00:00
d9e9345be2 fix some indentation of 6e05a00929
This was SVN commit r17164.
2015-11-01 16:47:53 +00:00
357203a90f Pathfinding changes: unit-unit collisions now allow for some overlap, so units can get closer to each other, which I found improved pathfinding considerably.
Also fix a potential issue I noticed in some cases, though that
particular fix implies scrapping waypoints, so if units seem to get
lost, please report so and I'll revert those changes.

I can't find any way to get units stuck with this patch.

This was SVN commit r17163.
2015-11-01 13:38:48 +00:00
14038d4cd8 Fix more pathfinding issues.
Change the way the long-range pathfinder rasterisation works slightly so
that we have a better compatibility with the short-range pathfinder.
Should fix the "stuck units" issues, though I am not sure so I am not
marking them as fixed so far. Refs #3471, #3505, and possibly #3292.

Caveat: I am now using clearance of 0.8 for "default" class, which might
have side-effects: please report anything weird.

Also fix leftover style issues.

This was SVN commit r17161.
2015-11-01 07:28:43 +00:00
a6111ff8b7 Fix #3309 by capping m_DeltaSimTime in NetTurnManager.cpp. Patch by elexis. Review by Philip.
This was SVN commit r17159.
2015-10-31 21:04:47 +00:00
6acfec0f44 Fix a logic error in the hierarchical pathfinder that resulted in it not updating all passability classes correctly. Fixes #3538, refs #3292 (it fixes one of the cases, but not the examples).
Also features style fixes, thanks leper for noticing.

This was SVN commit r17158.
2015-10-31 20:47:47 +00:00
a3f467ae4e Make resources have a static, passable obstruction. Ought to be a temporary fix. Fixes #3530
See #3530#comment:9 for a proper fix to this issue.

This was SVN commit r17156.
2015-10-31 15:28:42 +00:00
4d804cf26b fix typo in 6e05a00929
This was SVN commit r17155.
2015-10-31 13:42:14 +00:00
6e05a00929 fix obstruction of target entity not taken into account in short pathfinder, closes #3539
This was SVN commit r17154.
2015-10-31 13:37:34 +00:00
8494e36aa8 Revert the logic change in 9da482ead4. This commit removed the checks in UnitMotion against structures, which should have been fine except the short-range pathfinder and the long-range pathfinder are not entirely compatible (check out #3532 for details). This behavior was probably slightly optimized, but it was too clever for its own good in the current state of the pathfinder, might be reintroduced later.
This resulted in ALL "units inside obstructions" issues.

Thanks to elexis for the testing.

Fixes #3532, #3450.
Refs #3538 (still OOSes), #3410 (unitmotion remains buggy for
formations, but this is only aesthethic.)
Probably affects #3471 and #3505, but those are not fixed.

This was SVN commit r17152.
2015-10-31 08:43:31 +00:00
108633affd Fix #3415. Removes 'ghost' scrollbar bounding to enable extreme-right hover and selection in dropdowns. Patch by elexis.
This was SVN commit r17149.
2015-10-31 05:40:43 +00:00
e0771b98dd fix switch between square or circle approximation in UnitMotion, refs #3539
This was SVN commit r17145.
2015-10-26 22:59:26 +00:00
f4cb822d9d do the circle approximation also in INVERTED goals in UnitMotion, refs #3405
This was SVN commit r17143.
2015-10-18 20:23:02 +00:00
70d5e4e318 fix the INVERTED_CIRCLE and INVERTED_SQUARE PathGoal, fixes #3405
This was SVN commit r17142.
2015-10-18 20:21:20 +00:00
82590753d7 fix a moved function, fixes #3531
This was SVN commit r17137.
2015-10-16 17:14:39 +00:00
b97e565017 Fixes path formatting in Windows OOS error message, patch by elexis, fixes #3498
This was SVN commit r17134.
2015-10-15 03:50:45 +00:00
c0b4e78801 Fixes stream serialization bug on OS X 10.8 and older, which caused instant OOS in multiplayer games, fixes #3108.
Fixes test failures on OS X 10.7 and older, refs #3109

This was SVN commit r17133.
2015-10-15 03:31:30 +00:00
4043c56518 Fixes global init order bug that caused OOS between OS X and other platforms, fixes #3499. May improve pathfinding behavior in some cases, please test!
This was SVN commit r17132.
2015-10-15 02:51:12 +00:00
4994dfb26a Avoids RuntimeError: dictionary changed size during iteration
This was SVN commit r17127.
2015-10-11 20:47:52 +00:00
9db4fb5ddb fix typo in Game.cpp
This was SVN commit r17126.
2015-10-11 11:12:27 +00:00
b0f267b61c fix typo in UnitMotion, fixes #3474
This was SVN commit r17124.
2015-10-11 11:00:11 +00:00
f5348c6dd6 Introduce less rounding errors in the falloff to allow a more precise territory calculation. Fixes #3334. Based on code by elexis.
This was SVN commit r17122.
2015-10-11 09:01:50 +00:00
40acf66ba9 Fixes hotkey bugs introduced in a07add11c6, patch by elexis. Fixes #3495
This was SVN commit r17116.
2015-10-10 07:22:07 +00:00
02628b8902 Removes unused pathfinder consts, patch by stanislas69. Fixes #3500
This was SVN commit r17115.
2015-10-10 06:48:42 +00:00
e0093c8ecc Remove an unused function (it was used by the old pathfinder).
This was SVN commit r17103.
2015-10-04 18:02:16 +00:00
2505a2ec70 Remove a preprocessor ambiguity, fixes #3480.
This was SVN commit r17101.
2015-10-04 17:21:36 +00:00
cfe4a2e568 Fix a cause of serialization problems. Fixes #3450.
This was SVN commit r17097.
2015-10-03 11:02:12 +00:00
bb997f6cae Fix previous commit.
This was SVN commit r17096.
2015-10-03 10:32:30 +00:00
d60940ac59 Code improvements and style fixes.
This was SVN commit r17095.
2015-10-03 08:27:19 +00:00
dc69aed954 Remove some old and unused code.
This was SVN commit r17094.
2015-10-02 18:27:10 +00:00
102358a5cb Fix build for recent versions of miniupnpc.
This was SVN commit r17091.
2015-09-30 21:32:54 +00:00
061c7f6058 Const ref.
This was SVN commit r17090.
2015-09-30 20:28:23 +00:00
2132f868b8 Replace the rectangle rasterization algorithm by the original version from Philip's branch.
The current version is flawed (it doesn't handle the partially
obstructed cells as it should).

Refs #3410.

This was SVN commit r17084.
2015-09-27 16:46:26 +00:00
a7e0dc1534 update attack and heal range queries, patch by leper, fixes #3080
This was SVN commit r17082.
2015-09-27 12:23:40 +00:00
dcf8e66aca Update the goal serialization for 03d2c5e40b. Fixes #3425.
This was SVN commit r17068.
2015-09-24 17:13:39 +00:00
b830233498 Fix previous commit, some new files didn't pass through.
This was SVN commit r17055.
2015-09-21 17:14:26 +00:00
d64b95b28c An awesome Visual Replay menu, made by elexis. Fixes #3258.
This was SVN commit r17054.
2015-09-21 17:00:21 +00:00
3317e6c68b rename autostart visualreplay, refs #3258, patch by elexis
This was SVN commit r17050.
2015-09-20 12:29:59 +00:00
b77ad821c2 Reenable formations and fix/improve the communication between UnitAI and UnitMotion. With the new pathfinder some path requests can be completed instantaneously, so UnitAI has to handle MoveStarted messages even in the IDLE state.
Please note that this commit makes #3410 really visible. Formation
members might pass through buildings.

Refs #3410, #3337.

This was SVN commit r17028.
2015-09-17 16:31:23 +00:00
21619a4705 Move the victory conditions to the new simulation settings system. Patch by elexis. Refs #3355,#3001
This was SVN commit r17026.
2015-09-16 09:22:36 +00:00
7eefcbe8c5 Do not use non-static data member initializer.
GCC 4.6 does not support those and initializing it in the ctor is a lot
clearer in this case.

This was SVN commit r17022.
2015-09-15 00:55:03 +00:00
a65a8472f9 Mark some const functions as such.
This was SVN commit r17021.
2015-09-13 20:59:10 +00:00
ae3aad704d fix previous commit
This was SVN commit r17018.
2015-09-13 19:06:14 +00:00
9816e7c92d Rename some variables to point out that they are only used in visual replay. Add script function IsVisualReplay. Refs #9 #3355, patch by elexis
This was SVN commit r17017.
2015-09-13 19:03:33 +00:00
ae6475fcc0 Fix a typo, patch by godlikeldh.
This typo didn't have any influence since dirty unit shapes are usually
discarded during the rasterization (they don't block long-range
pathfinding). Switching the order of a check in RasterizeHelper prevents
performance problems to a really small extent.

This was SVN commit r17014.
2015-09-13 10:18:37 +00:00
03d2c5e40b Support inverted goals with the long-range pathfinder. This allows units to flee and should fix problems with ranged units too close to their targets. Fixes #3405, refs #3372.
Now that units flee it's necessary to fix the unit chasing: this commit
reintroduces some code from 298115f4c5 that disappeared with the
committing of the new pathfinder. Refs #1537.

Also includes some style improvements to the UnitMotion code.

This was SVN commit r17013.
2015-09-13 09:33:09 +00:00
8507a7bc27 Create commands.txt only when actually starting the game. Patch by elexis. Fixes #3408.
This was SVN commit r17004.
2015-09-11 17:44:50 +00:00
558695365d Add some documentation about system components. Fixes #3315.
This was SVN commit r17003.
2015-09-11 04:10:26 +00:00
fc051d94cc Add check for non-passable (likely water-only) maps to territory percentage calculation.
Patch by s0600204. Fixes #3407.

This was SVN commit r17002.
2015-09-11 02:16:21 +00:00
9da482ead4 Based on previous experimental changes, major update to the unit motion.
With this change, units will not check their movement against all
obstructions when moving: terrain and static obstructions are assumed to
be handled by the long-range pathfinder.
However, when static obstructions are changed, the paths have to be
invalidated. In order to minimize the performance impact, units will
check for obstructions when they move after a passability change. If
they collide with something, they will recompute a path that will take
into account the new passability map.

Also includes some code cleanup. This patch should not change
performance a lot: the lower number of checks should give a small
performance improvement while using the message broadcasting system
should hurt it a bit.

Fixes #3376, #3337, #1914.

This was SVN commit r16998.
2015-09-10 18:12:13 +00:00
8b437a0b1c Fix #3386, patch by elexis.
This was SVN commit r16997.
2015-09-10 05:30:18 +00:00
5a685b84ca Recompute the cost grid in the TerritoryManager when needed. Patch by s0600204. Fixes #3399, #3400.
This was SVN commit r16990.
2015-09-06 22:35:38 +00:00
4e3b933b11 Fixes some issues in checkrefs.pl: soundgroups have new gender and lang tags, PMP version bump, GUI XML can include directories, civ data path changed
This was SVN commit r16987.
2015-09-06 04:42:28 +00:00
448b8248cf Revert my experimental changes from the previous days. Hopefully I can design something that doesn't introduce a ton of new issues. Refs #3376
This was SVN commit r16986.
2015-09-05 18:20:08 +00:00
1d89d05956 Don't try to short-path to non-point goals, because the algorithm won't deal with connectivity. Fixes another bug reported in #3363.
This was SVN commit r16985.
2015-09-04 20:43:05 +00:00
3005637370 Make a compromise between f240374b28 and f134ac63bb by making the filtering of pathfinding-blocking shapes conditional.
Those shapes need to be taken into account when computing a short path,
but they need to be discarded when checking movements or they will
create long/short inconsistencies.

This was SVN commit r16981.
2015-09-03 20:09:25 +00:00
ad9736b5a5 Fix Arabic plural equation in tinygettext.
Patch by SafaAlfulaij taken from
https://github.com/tinygettext/tinygettext/pull/8.

This was SVN commit r16980.
2015-09-03 16:42:05 +00:00
7d6553099f Fix wrong offset when clicking too close to the header of sortable lists. Also added some code comments.
Patch by elexis, fixes #3391

This was SVN commit r16976.
2015-09-02 17:55:02 +00:00
8dde1cda94 Style cleanup, and remove a wrong TODO.
This was SVN commit r16974.
2015-09-02 17:40:31 +00:00
f134ac63bb Revert most of f240374b28 which was actually bad. It caused units to get stuck because the obstructions won't block the same paths when rasterized on the grid and when directly tested for collisions.
As a general rule, pathfinding-blocking shapes should not be tested
against for movements. Only the passability grid should be considered.
As the algorithm which tests paths on this grid was fixed in 1c9ea56800,
it can be safely used.

Fixes #3376.

This was SVN commit r16971.
2015-09-02 15:50:16 +00:00
8a8a3b8377 Revert a wrong piece of code from 63e42fbd31. Refs #3293
This was SVN commit r16965.
2015-08-30 20:32:22 +00:00
1a15131d2d Lobby bot optimizations.
This was SVN commit r16964.
2015-08-30 17:50:16 +00:00
63e42fbd31 Display which player(s) are OOS when it happens. Also fix some encoding issues with file paths.
Patch by elexis, fixes #3293.

This was SVN commit r16963.
2015-08-30 17:47:18 +00:00
f47cb2c711 Fix the OOS reported by elexis in #3335, and clean some whitespace and style.
The list of modified entities was thrown out on global visibility
updates (those happen on rejoin) but only in-world entities were
actually updated then, causing problems with garrisoning.

Now the list of modified entities can happen to be large, so replace the
hacky check for infinite loops by a real check.

This was SVN commit r16962.
2015-08-30 17:42:10 +00:00
45a39e7dfd Fix 3171 by moving some logic to C++. These changes do not optimize the presence buffer and only fix the state bug.
This was SVN commit r16961.
2015-08-30 12:56:48 +00:00
2aef62d65f Handle backrefs properly for maps and sets. Fixes #3374.
Allocate the tag for the backreference before deserializing the content,
to match the order of serializing.

This was SVN commit r16959.
2015-08-30 04:51:16 +00:00
57f340f906 Fix player rejoins. Refs #3242.
This was SVN commit r16955.
2015-08-30 02:03:50 +00:00
c9893b3dd0 Test serialization of nested maps. Refs #3164, #3374.
This was SVN commit r16954.
2015-08-30 00:06:39 +00:00
8217fa1a0e Warn about range queries that can never return any results.
This was SVN commit r16951.
2015-08-29 22:49:49 +00:00
e56dddbefb Optionally allow observers to rejoin a game when they weren't here during the game setup.
Patch by elexis, fixes #3242.

This was SVN commit r16945.
2015-08-28 20:20:10 +00:00
8e70140ec2 Handle properly static shapes that overlap the edge of the map (likely to happen with square maps).
This should fix #3364.

This was SVN commit r16944.
2015-08-28 11:38:14 +00:00
34555ad70c Enhance i18n extractor to support a single context for a json file. Patch by elexis. Refs #3355.
This was SVN commit r16942.
2015-08-27 19:07:36 +00:00
d129ae3cd8 Fix a special situation where map control percentage wasn't computed properly.
Also improve the code and fix a typo.

Based on patch by s0600204, fixes #3378.

This was SVN commit r16941.
2015-08-27 16:26:32 +00:00
b9ab8f5855 Explicitly include public's mod.json in Windows packages.
Also clean up some unused options in the dist script.

This was SVN commit r16939.
2015-08-25 12:55:05 +00:00
a63b7a0126 Add ability to query the map control percentage, and use this value in the summary screen. Patch by s0600204, fixes #3321
This was SVN commit r16933.
2015-08-23 17:44:37 +00:00
b694ab41d9 Show the number of trade carts and looted resources in the summary screen. Patch by bb, fixes #3311
This was SVN commit r16932.
2015-08-22 17:57:41 +00:00
74c420f658 GUI code cleanup. Fixes #3354.
Lots of code style fixes:
 * type [*&]varname -> type[*&] varname
 * else
   if (...)
   ->
   else if (...)
 * Spaces around some ops.
 * i++ -> ++i.
 * switch-case style fixes.
 * Indentation fixes.
 * Removing some commented out code.
 * include header sorting
 * Changed multiple pointer var declarations to be one per line.
 * Removed strange spaces in some places.
 * Changed some include header guards to be consistent with the rest of
the codebase.
 * Use UNUSED() instead of UNUSED2().

Some small code fixes:
 * Using .find() instead of .count() == 0.
 * !.empty() instead of .size() == 0.
 * Range-based for loops.
 * Making some member functions const by small changes.
   * Adds GetScrollBarPos(idx) const for this.
 * Using early returns/continues in some places.
 * Uses size_t for some loops in CList and COList.
 * Removes unused heading element (not attribute) from COList.
 * Use ENSURE in one case where some custom code did something similar.
 * Made some parameters const ptrs/refs.
 * Change removal loop in GUItext.cpp to erase-unique.
 * Made some static things const.
 * Allow iterating over children of IGUIObject with range-based for
loops by
   exposing begin() and end() (rename from ChildrenIt{Begin,End}()) and
use it.

Comments:
 * Comment COList.
 * Update a few comments.
 * Remove useless or duplicated comments.

This was SVN commit r16931.
2015-08-21 17:08:41 +00:00
a63e9c521d Optionally limit the framerate in menus to 50 FPS, to save power. Patch by elexis, fixes #2882
This was SVN commit r16927.
2015-08-20 13:22:44 +00:00
ba82743777 Some range-based for loops.
This was SVN commit r16926.
2015-08-20 12:58:41 +00:00
b2e8a241d2 Properly check loaded scripts in the second simulation instance of a serialization test. Fixes #3238
This was SVN commit r16925.
2015-08-20 12:52:29 +00:00
1ab3a4a02d Fix 6506bc20cb, refs #3238
This was SVN commit r16924.
2015-08-20 12:49:43 +00:00