Iterating using a for..in over an array returns the indices as string,
not number, which C++ did not accept.
Differential Revision: https://code.wildfiregames.com/D1864
This was SVN commit r22254.
The vertex pathfinder was implemented directly in CCmpPathfinder,
instead of being a separate helper like the hierarchical pathfinder or
the long pathfinder.
This moves it to its own helper VertexPathfinder, which gets us ready
for D14 and pathfinder threading. Some struct definitions need to be
moved around.
Differential Revision: https://code.wildfiregames.com/D1855
This was SVN commit r22253.
Because of the limited precision of our fixed-point numbers, the
timeLeft calculation could sometimes return results above the actual
time left, resulting in units moving a few fixed::epsilons farther than
they should be, which makes them switch to the running animation. This
was rather unstable however, so there was a constant 'flickering'
between walking and running.
If we divide last instead of first in the operation, the errors get
gobbled up by the division and we no longer have this issue.
Reported by: wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D1856
This was SVN commit r22249.
Motive behind the change: calls to Profile() currently crash unless they
are triggered from the main thread, but it's somewhat difficult to know
that from the code. It makes more sense to silently ignore those
particularly so we can easily have the same code be threaded or not.
This also removes a few profiling calls that don't make much sense.
Differential Revision: https://code.wildfiregames.com/D1853
This was SVN commit r22248.
Following b56f7f39d4 I dwelled in the fogging code. Some confusion could
have been avoided by some comments.
Also early-exit the loop to avoid doing un-necessary js->c++
transitions.
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D1737
This was SVN commit r22247.
1x1 is now a 1x1 grid unit for the game 2x2m unit in blender , that you
can see using THE Wireframe mode or the special texture in atlas.
Resize and adapt existing foundations accordingly
Unify construction dust, it only appears when building (scaffold
variant)
Add 64 foundations from 2x1 to 9x9 and corresponding dirt decals
Add three new scaffolds based on Lordgood's for walls
Rename props to use lowercase names as per art conventions and update
the maps accordingly.
Use 0x instead of a b c and d as per the art convention.
Add missing materials tags, and only use special textures when necessary
Template update will be done in the following commit.
This was SVN commit r22239.
Add a missing semi-colon
For future reference on documenting records using JSDoc see the
differential.
Reviewed by: @elexis
Differential Revision: https://code.wildfiregames.com/D1848
This was SVN commit r22229.
Debug variables are kept mutable as one otherwise has to use a complex
system and this is really not worth it.
Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1491
This was SVN commit r22219.
FindPassableRegions intends to return all passable regions in a chunk,
but did not as it used the number of regions in that chunk. In fact,
regions can have individual IDs higher than the number of regions (as
shown by the test), therefore FindPassableRegions might miss some.
This only affected the JPS pathfinder, when starting on an impassable
cell, which called FindNearestPassableNavcell with then possibly
returned a sub-optimal navcell. This is a limited impact but upcoming
patches will rely on that function more.
Fixed using a vector to store IDs, which also makes for-range loops
usable.
Differential Revision: https://code.wildfiregames.com/D1832
This was SVN commit r22218.
Includes some style normalization.
Refs 60cfd2d16c.
Patch By: Stan
Reviewed By: vladislavbelov, Itms
Differential Revision: https://code.wildfiregames.com/D1845
This was SVN commit r22216.
Use at() over find() as it makes the code neater and the performance
impact is negligible.
This forces an algorithm change in FindReachableRegions as the key
accessed is not guaranteed to exist.
Differential Revision: https://code.wildfiregames.com/D1830
This was SVN commit r22210.
These variously test some simple MakeGoalReachable and
FindNearestNavcell calls, as well as checking edges and regions when
updating the map.
Differential Revision: https://code.wildfiregames.com/D1833
This was SVN commit r22205.
The template tree included 'template_unit_mechanical.xml', which had two
children, '*_ship.xml' and '*_siege.xml'.
This template did little and implied a relevant common ancestor to ship
and siege units. As organic units do not descend from a generic
'Organic', this was not necessary.
This commit removes this template and the '_mechanical' bit from
children templates to simplify.
Additionally, this renames:
- template_unit_mechanical_siege_ballista.xml to
template_unit_siege_boltshooter.xml
- template_unit_mechanical_siege_onager.xml to
template_unit_siege_stonethrower.xml
This helps avoid ambiguity, as our Roman ballista for example throws
stones (even if it is a torsion engine), and 'ballista' refers to a bolt
shooter in Age of Empires 1 (and in AoE 2 for the Elephant Ballista,
confusingly not named a scorpion like other bolt shooters in that game).
Patch By: Nescio
Reviewers: Wraitii
Subscribers: Itms, O14 Maps, wraitii, elexis, Vulcan, Stan
Differential Revision: https://code.wildfiregames.com/D1760
This was SVN commit r22204.
While at it:
- Remove the stone cost/loot from palisades
- Change the gate tooltip to not mention stone walls
- Standartize palisade armour (don't reuse the walls' armour)
- Demand village phase instead of town phase for all palisades
- Remove stone wall classes from palisades
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1796
This was SVN commit r22202.
f0d9806b3f added a problem: Engine.GetGuiObjectByName is unaware of the
caller GUI page.
So GUI pages in the background that still run the onTick and other event
code tried to look on the topmost GUI page, rather than their own GUI
page.
9674c3c0fe added a workaround that has to be copied to any place that
can call JS code.
If developers don't know about the reason for this workaround and add a
new place that can call JS code (#5369), they won't be able to implement
anything.
This removes this workaround by passing the pointer to the correct GUI
page as callback data.
Patch By: elexis
Reviewed By: wraitii
Refs #5369
Trac Tickets: #5369
Differential Revision: https://code.wildfiregames.com/D1701
This was SVN commit r22200.
This changes running speed into a running multiplier (of walk speed).
The advantage is that it simplifies code since you can setup a default
run multiplier at the template level and it'll work for all subsequent
templates, and technologies cannot forget to change it. It makes
specialised unit templates easier to maintain, too.
Formations have a 100 run multiplier which effectively sets their
maximal walking speed at 100
Reviewed By: bb, O2 JS Simulation
Differential Revision: https://code.wildfiregames.com/D438
This was SVN commit r22197.
Do not flag a unit as injured when it receives 0 damage.
Do not flag dead units as injured.
Do not mark units as injured when they are full health and killed at one
shot.
Cleanup Reduce, introducing a separate function to handle deaths.
Patch By: Angen
Reviewed By: wraitii
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D1769
This was SVN commit r22196.