When adding a batch of unit, these in-training units get added to the
production queue and to the entity limit count.
These in-training units need to be removed from the entity limit counts
when spawning them, or we would be double-counting them. This was done
when creating the cached entities, but this was too early: entities
might fail to spawn, for example when there is no room around the
foundation.
Change that so the entity limit count is now decremented right before
giving spawned entities the correct owner (which triggers EntityLimits
OnGlobalOwnershipChanged, which adds the spawned entities to the entity
limit count).
Additionally, add Init to TrainingRestrictions so that the test setup
doesn't complain. Other components have an empty Init instead of
checking for Init in the test setup (and 61/67 have an Init function) so
it seems more standard this way.
Reported By: elexis
Reviewed By: wraitii
Patch By: Angen
Tests By: wraitii
Differential Revision: https://code.wildfiregames.com/D1879
This was SVN commit r22375.
0c20afdfda made states more caller-independent but did not change some
callsites to be compatible with that. This fixes those.
This does not fix chasing entirely however since unitMotion does not
always recognize that the target moved enough that the entity will never
be in range.
This will be fixed upstream.
Differential Revision: https://code.wildfiregames.com/D1968
This was SVN commit r22367.
4fda917f46 introduced mistakes in range checks which sometimes broke
garrisoning and repairing.
Reported By: gameboy
Differential Revision: https://code.wildfiregames.com/D1963
This was SVN commit r22353.
UnitAI is now solely in charge of moving and stopping, making UnitMotion
behaviour easier to predict, which will ultimately help with unitAI
development. It might temporarily make units more resilient than before
however.
UnitMotion also tells UnitAI that it's arrived with "MoveCompleted"
messages, but these actually could be wrong - unitAI could decide that
we didn't want to stop after all - so change the name for something less
misleading.
Differential Revision: https://code.wildfiregames.com/D1886
This was SVN commit r22351.
"MoveStarted" messages were sent by UnitMotion when the unit started
moving (sort of) or failed to do so. This was used by formations and
guarding but was not really necessary as this can be done in "enter" or
in a timer.
Differential Revision: https://code.wildfiregames.com/D1885
This was SVN commit r22350.
These functions were placed in UnitMotion, which had nothing to do with
range checks and made them available only to moving entities for no
particular reason.
This patch also adds support for square-square range checks and
shape-shape distance checks.
Modified from a patch by bb on top of work from wraitii.
Differential Revision: https://code.wildfiregames.com/D981
This was SVN commit r22345.
Reuse the timer code in the gathering sub-state to avoid broken
duplication.
Reported By: minohaka
Test By: Angen
Differential Revision: https://code.wildfiregames.com/D1956
This was SVN commit r22342.
0c20afdfda had two issues:
- some of the unitAI code did not return true when switching states in
the "enter" phase
- missed a return false in unitMotion.cpp
This fixes the issue noticed by @bb.
Differential Revision: https://code.wildfiregames.com/D1947
This was SVN commit r22339.
Add the tech to ranges, and make them also pop upin captured barracks
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1941
This was SVN commit r22329.
- Rename civil_centre to civic_center
- Rename the shield prop object to a more explicit name.
- The template and the rubble template should be renamed in another
commit to make sure that do not affect the AI.
This was SVN commit r22327.
Including:
Remove LongWall from gates
Change the ("unused") gate cost component in more reasonable number and
adapt the repairTimeRatio with it to keep the health/second the same
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1794
This was SVN commit r22325.
Including:
moves template_structure_military_barracks_stables.xml to
template_structure_military_stable.xml
updates all its children accordingly
merges values from pers_stable.xml into the new generic template
changes generic name Stable (singular, without s)
standardizes rubble sizes to 5x5 (pers had 4x4)
corrects specific name for Greek factions
adds foundation actor to kush_stable.xml
Patch By: Nescio
Comments By: Angen
Differential Revision: https://code.wildfiregames.com/D1790
This was SVN commit r22322.
There was a setback when I used tinypng to compress the images as it
eliminated necessary image component.
Reviewed by: Stan
This was SVN commit r22318.
This also moves the actual "moving" code to states instead of orders,
making states more self-contained and removing the change of errors when
cleaning up a state.
Differential Revision: https://code.wildfiregames.com/D1865
This was SVN commit r22313.
Fix some decals,
Remove AO suffix,
Rename struct_b to roof
Use stable_elephant as per the art convention
<general>_<civ>_<type>_<extra>_<variation>
This was SVN commit r22306.
This implements a status effects receiver component (in a similar
fashion to the damage receiver component). The plan is to further extend
this component notably to handle graphical indication of status effects,
and a variety of other effects.
Currently implemented: ranged attacks can inflict status effects that
reduce HP over time.
This can be resisted by armour.
No units currently utilise this in-game but with proper graphics support
that could be changed.
Patch By: Mate-86
Reviewed By: wraitii
References #1912
Differential Revision: https://code.wildfiregames.com/D1252
This was SVN commit r22304.
This improves refractions around entities close to the surface, such as
fishes, by handling depth better and by clipping the water plane a
little lower.
This uses the skybox for reflections when refractions are enabled but
reflections are disabled, making it possible to play with reflections
disabled without having super-ugly water (arguably a performance
improvement).
Differential Revision: https://code.wildfiregames.com/D359
This was SVN commit r22297.
This uses trigger to create some scientific test cases for unit motion
(the whole unitAI->Motion->Pathfinders stack)
Differential Revision: https://code.wildfiregames.com/D1892
This was SVN commit r22296.
Make all the props in the blacksmith buildings separate
Add three tools, one hammer, two tongs
Use the new briton shields on the blacksmith
Use the new helmets on the blacksmith
Add new crates, and gives it a bit more geometry.
Update the anvil eyecandy prop
This was SVN commit r22290.