HEAL can infinite loop: if the HEAL.APPROACHING:MoveTo call fails, the
unit will fallback to FINDINGNEWTARGET, which looks for new targets to
heal, which can loop around.
In #6106, the cause was that the target was not visible despite the
order being given (presumably a rangemanager/los incompatibility issue).
When MoveTo() fail, orders usually call FinishOrder as that's
irrecoverable.
Further, GATHERING/COLLECTINGTREASURE also did not FinishOrder - there,
we do want to consider new resources if the target is e.g. unreachable,
so add an explicit check for AbleToMove.
Reported by: moiman
Reviewed By: Freagarach
Fixes#6106
Differential Revision: https://code.wildfiregames.com/D3689
This was SVN commit r25075.
This new MotionManager handles movement for UnitMotion components (not
UnitMotionFlying).
This is a first step towards unit pushing, by giving a central place for
the relevant units to collide.
One important side-effect is that movement is effectively synchronous -
the positions are not actually updated until all units have moved for a
turn (refs 6a66fb8205).
As a side-effect, it's an optimisation: fewer messages are being sent
overall, which leads to a slight speedup (negligible without a lot of
units though).
This is a first step - ideally, the movement functions called from
UnitMotionManager would actually be moved there.
Differential Revision: https://code.wildfiregames.com/D3509
This was SVN commit r25071.
The "GARRISONED"-state was quite strange, for entities being garrisoned
can just as well perform other tasks (see e.g. turrets).
Also, the need for keeping a "garrison" order on the stack is removed.
Fixes: #6022
Differential revision: D3656
Refs. #6081
This was SVN commit r25069.
Use a map that stores the functions instead of them being part of the
Mirage component.
Means that a lot doesn't need to be inited now (refs. #5979).
Ticket: #5985
Differential revision: D3694
Comments by: @wraitii
This was SVN commit r25068.
- Remove LevelID harcoding
- Forward the initial data to the endgame script.
- Update the currentRun logic to make it behave more expectedly.
Differential Revision: https://code.wildfiregames.com/D3649
This was SVN commit r25065.
Have an entity cache per item (refs. #6104) (which means it doesn't need
to be created at init; refs. #5979).
Cache the PQ-position instead of querying it for every spawned entity.
One could use any arbitrary player for spawning entities now, increasing
mod support.
Differential revision: D3669
Comment by: @wraitii
This was SVN commit r25064.
Removes indentation.
Adds return value.
Cache owner instead of querying often.
This function can be cleaned even more later.
Differential revision: D3670
Comments by: @wraitii
This was SVN commit r25063.
Structures have them since ad1ab0c3d3, but units were excluded there due
to their mobility and amounts.
Artillery is not that easily massed and also not very mobile, but has a
high range and damage with a low reload time, making it nice to know
their approximate range.
Patch by: @Nescio
Differential revision: D3606
Comments by: @Angen, @borg-, @wraitii
This was SVN commit r25061.
There is no fruit on the map, therefore much like wood techs, the fruit
tech is disabled.
Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3595
This was SVN commit r25059.
- Fishing boat build time from 20 to 15 (5 less than bireme/merchant).
- Quinquereme population from 3 to 5 (biremes have 2, triremes 3)
- Warships get a 2:1 wood to metal cost
- Loot is standardized to 20% of costs, XP to 10% of health, similar to
siege engines and structures.
- Fishing boath & Merchant ship have the same resistance as warships but
accordingly lower HP, for easier stat comparison.
Patch by: Nescio
Accepted By: borg-, wraitii
Differential Revision: https://code.wildfiregames.com/D2956
This was SVN commit r25058.
D3482/5701ffccf8 raised the melee attack range to 6 to compensate for
movement over a turn with 500ms MP turns.
Following D3275/d4c2cf4430, this is no longer necessary. Revert to 4
(half the footprint length + 1 & their capture range).
Patch by: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3673
This was SVN commit r25057.
This runs linting using the "arc lint" command of arcanist, which
notably gets run automatically as part of the arc diff workflow.
Changes:
- The major change is that arc lint reports, by default, only issues on
changed lines instead of changed files (--lintall changes that).
- JSHint is largely redundant with eslint and does not support some of
the new Javascript functionality that we are able to use in 0 A.D., such
as conditional chaining, thus it is removed (of course, users can still
run it manually).
- Eslint 7 is supported out of the box and updated to ES 2020
- cppcheck and eslint are optional - if the executable is not found
(e.g. in PATH), it will fallback to a 'dummy' PHP script that does
nothing. This has been tested on windows, mac and Debian (CI).
- The licence year linter now suggests replacement, and has been
rewritten as an arcanist linter.
- Add a JSON error linter.
The intention is to have non-intrusive external linting, and largely the
same text linting.
Coala has largely gone unmaintained in the past few years (more so than
arcanist anyways) and installing it on modern Python is convoluted.
Differential Revision: https://code.wildfiregames.com/D3639
This was SVN commit r25056.
- Renames the elephant_stables.xml templates to elephant_stable.xml
(without plural s), as well as their generic template_*.xml parent,
consistent with e.g the stable.
- Corrects all occurrences in simulation and map files accordingly.
- Renames the stable and elephant stable audio files.
- Drops pers_ from the barrack.png and stable.png icons.
Patch by: @Nescio
Differential revision: D3343
This was SVN commit r25053.
getEntityById calls .has before actually getting the entity by .get and
otherwise returns undefined.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get
The element associated with the specified key, or undefined if the key
can't be found in the Map object.
So calling has is redundant causing performance loss.
Differential revision: D3653
Reviewed by: @Freagarach
This was SVN commit r25048.
Teach her to build advanced houses available for cart players as they
provide more population.
Reviewed by: @Freagarach
Differential revision: D3654
This was SVN commit r25047.
- Rename `RemoveBatch` to `RemoveItem`.
- Refactor that function. (Don't clear the cached entities when *any*
item is removed.)
Fixes the bug that the training is still blocked when a tech is the next
in the queue and the blocking item is removed.
Based on a patch by: @Polakrity
Differential revision: D1843
Comments by: @Angen, @bb
This was SVN commit r25040.
- Use an interval instead of requesting a timeout every timeout.
- Integrate the lateness-parameter.
- Some other cleanup.
- Don't create objects for null values in messages.
- Don't create this.timer on init.
Based on a patch by: @Polakrity
Differential revision: D1906
Comments by: @Angen, @Stan
This was SVN commit r25038.
- Combines multi-spaces into one.
- `\u000a` -> `\n`.
- Proper quotation marks instead of programmers quotes.
- A few typos.
- Capitalise classes.
Scenarios and skirmishes are excluded due to checkrefs.pl not being able
to handle proper quotes in XML.
Patch by: @Nescio
Differential revision: D3493
Comments by: @Stan
This was SVN commit r25037.
- Listing all damage types everywhere is not needed anymore, therefore
0-damage lines are purged.
- Trailing zeros are removed from <Attack> node lines (e.g. <MaxRange>,
<Spread>), per @bb.
- Attack nodes in templates that were effectively replaced by all their
children are deleted too.
- Clean up the confusing and haphazard attack situation in the fauna
templates.
- The now obsolete template_unit_fauna_wild_defensive_fox.xml is
deleted.
- All animals got an attack range that's at half their footprint length
+ 1 and an attack <PrepareTime> that's half their <RepeatTime>, for
consistency.
Patch by: @Nescio
Differential revision: D3342
This was SVN commit r25036.
Makes sure GarrisonHolders don't need to needlessly listen to global
ownership changes anymore.
Also fixes dying entities on turret points.
Refs. #6081
Differential revision: D3648
This was SVN commit r25031.
Since the only way of garrisoning is using `cmpGarrisonable`.
025a00340e introduced the `this.isGarrisoned`-flag, its meaning was
discussed in https://code.wildfiregames.com/D1403.
Refs. #5979, #6081
Differential revision: D2379
Comments by: @elexis, @Stan, @wraitii
This was SVN commit r25030.
Meaning GarrisonHolders won't listen for GlobalEntityRenamed messages
uselessly for the rest of the match after init.
Refs. #6081
Differential revision: D3627
This was SVN commit r25029.
It is better to do case-insensitive search.
Improves on a4852c4c01, though the sensitivity is only an issue since
09ad8bfbe5
Tested by: nwtour
Reported by: nwtour
Differential Revision: https://code.wildfiregames.com/D3647
This was SVN commit r25027.
This makes the cache work consistently if replays are changed
externally.
Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3615
This was SVN commit r25026.
POF introduced in afd1eaee0d.
Placing foundations takes another route, for which was warned in the
original ticket but not done nonetheless.
This fixes that route.
Differential revision: D3642
Comments by: @wraitii
Fixes#6090
This was SVN commit r25024.
- adds JSON files to specify the human-readable categorization, name and
description of hotkeys.
- clean up code
Translation support via messages.json not yet added - the strings need
another pass and that avoids translators doing redundant work. See D3641
Refs #5867, Refs #5996
Differential Revision: https://code.wildfiregames.com/D3596
This was SVN commit r25023.
Fixes D11 / 1c9efa6fb5.
The problem is that some GUI pages were simply named "page.xml" which
the regex didn't like.
Accepted By: Nescio
Differential Revision: https://code.wildfiregames.com/D3644
This was SVN commit r25022.
Follow-up to e18001e897.
This moves responsibilities even further to the garrisoning entity.
Fixes the garrison flag when renaming entities cannot garrison (#5906).
Allows easy fixing of #6087.
Ticket: #6081
Differential revision: D3628
Comments by: @Stan, @wraitii (also in length on IRC)
This was SVN commit r25019.