Commit Graph

283 Commits

Author SHA1 Message Date
Gustas
7b01204eed Spawn aircraft landed and occupying land or at cruise altitude 2024-07-20 18:47:58 +02:00
Vapre
64cdfcbeab Cache ICrushable traits in actor. 2024-01-31 13:29:58 +02:00
Gustas
018777472a Fix harvesters teleporting when produced
And allow to interrupt actor creation child activities
2023-12-03 19:27:02 +00:00
Gustas
20f6e01afe Fix crashing when transports are loaded via lua 2023-12-03 19:27:02 +00:00
RoosterDragon
360f24f609 Fix IDE0055
This rule no longer appears to be buggy, so enforce it. Some of the automated fixes are adjusted in order to improve the result. #pragma directives have no option to control indentation, so remove them where possible.
2023-11-16 08:45:10 +02:00
Gustas
60a446123b Fix TakeOffOnCreation 2023-09-23 18:39:58 +02:00
RoosterDragon
2ac855488b Validate order targets when resolving orders. 2023-09-07 17:46:35 +03:00
Gustas
3ab421cbe3 Allow queueing up scatter and move Nudge to an activity 2023-08-08 16:10:53 +02:00
Gustas
d686634c0b Fix aircraft jittering 2023-08-05 13:27:32 +02:00
EoralMilk
b944b21325 Aircraft won't take off on terrain height change when idle 2023-07-25 12:48:50 +03:00
RoosterDragon
f4af5c1764 Fix CA1852 2023-06-06 11:51:47 +03:00
Gustas
dc390a7301 Add IMove.MoveOntoTarget interface
In `TraitsInterfaces` we expose offset as WPos instead of CPos. In an upcoming PR we'll translate the same change to yaml.
2023-04-21 18:29:43 +02:00
RoosterDragon
8a285f9b19 Fix IDE0090 2023-04-08 16:51:51 +03:00
RoosterDragon
164abfdae1 Fix IDE0083 2023-04-08 16:51:51 +03:00
RoosterDragon
98c4eaca83 Fix IDE0032 2023-03-14 13:41:25 +02:00
RoosterDragon
53e9f44972 Spelling fixes 2023-03-02 20:11:54 +02:00
Gustas
8d0fe52dd8 Remove unnecessary parentheses 2023-02-27 08:36:47 +02:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
Gustas
57143087d7 Fix Aircraft not updating influence when changing height
Occupied cells was defined by height yet we didn't update actor map on changing height. This in some scenarios could have caused the aircraft to forget to remove its influence from actor map
2022-10-30 14:01:32 +01:00
Gustas
858d782af1 Simplify 'default' expression (IDE0034) 2022-10-11 17:40:05 +02:00
Gustas
7f677f1842 Allow driving under crates and crushable units 2022-10-07 21:06:04 +02:00
Matthias Mailänder
d3a8b07f05 Remove unread private member (IDE0052) 2022-09-13 10:36:57 +03:00
RoosterDragon
d2a3659078 Fix landed aircraft above ground level not removing influence on take off.
When the Land activity is run, the aircraft adds influence to the cell so it cannot be used by other actors. When the TakeOff activity runs, it removes the influence so the cell can be used by other actors.

However, when a Carryall picks up a unit, it is told to Land with a vertical offset - it never reaches ground level. When the TakeOff activity runs, it saw the aircraft was above ground level and bailed out. The means the influence is never removed. The cell is now unusable despite the fact the Carryall has left.

To fix this, TakeOff now checks if influence was applied instead of checking if the aircraft is above ground level. If so, we know the Land activity had decided that influence was required, even if the aircraft has not made it to ground level. When TakeOff runs, it will treat it as a proper take off event even though the aircraft is already above ground level. This means influence will be removed and the cell will become accessible as intended.

In ActorMap, we also fix a design flaw where disposed actors where excluded from queries. This caused cache inconsistencies with clients using ActorMap.CellUpdated event to rely on updates. This event will not get called when the actor was disposed, so the downsteam client may have cached the actors at that location, only for them to "change" when the actor is later disposed. This could cause the Locomotor and HierarchicalPathFInder to have inconsistent views of the actors on the map, causing crashes if the inconsistent state broken some internal invariants. The only reason to exclude disposed actors would be to cover up for the actors not being removed properly from the map, which is fixed now aircraft are handled correctly. If ever an actor isn't removed from the actor map, then the caller needs fixing rather than having the actor map exclude it.
2022-09-11 20:04:12 +03:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Eduardo Cáceres
79f321cb44 .Any(), .Count() -> .Count or .Length 2022-05-18 11:42:36 -05:00
Matthias Mailänder
0e7ad43425 Remove unused parameters. 2022-04-01 23:30:26 +02:00
reaperrr
a17af87a5e Fix aircraft with TakeOffOnCreation=false not freeing exit
...when another actor gets produced.
2022-02-06 19:20:29 +01:00
reaperrr
44fc4a1d0f Fix random placement of AssociateWithAirfieldActivity
It doesn't belong to IMove, so it doesn't belong into that region.
Put it near ICreationActivity where it belongs.
2022-02-06 19:20:29 +01:00
Matthias Mailänder
b147da388a Mark fields readonly. 2021-12-06 13:19:28 +01:00
Matthias Mailänder
9d905d8291 Remove unused parameters and variables. 2021-12-06 13:19:28 +01:00
Matthias Mailänder
07815143f1 Fix CA1825 warnings on empty array initialisation. 2021-12-06 13:19:28 +01:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
reaperrr
df8295fa2c Make aircraft turn speed scale with speed modifiers 2021-07-04 21:26:45 +01:00
reaperrr
0ac277a88d Improve Aircraft TurnSpeed getters readability 2021-07-04 21:26:45 +01:00
reaperrr
5a548d6acc Introduce IdleMovementSpeed
That actually factors in speed modifiers and trait pause/disable.
2021-07-04 21:26:45 +01:00
reaperrr
5ecb3eec16 Fix IdleTurnSpeed ignoring trait pause/disable 2021-07-04 21:26:45 +01:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
Paul Chote
8d2ec78713 Replace TerrainType.CustomCursor with Mobile.TerrainCursors. 2021-05-04 11:56:23 +02:00
Paul Chote
b344bba59a Expose Aircraft move cursor to yaml. 2021-05-04 11:56:23 +02:00
teinarss
e12ff2c59d Remove our own ReadOnlyDictionary and update usages 2021-04-03 11:33:31 +02:00
Matthias Mailänder
bbbed49f82 Add a lint check for cursor definitions. 2021-03-20 17:37:16 +01:00
reaperrr
2473b8763b Rename methods/activities with Visual in them
While they may be only 'visual' in terms of influence/cell grid,
they all do update CenterPosition, which is essentially the
actual world position of the actor.
'Visual' would imply that it only affects the position where the
actor is drawn, which is inaccurate.
Furthermore, using the term 'Visual' here would make
naming future methods/properties related to visual interpolation
unnecessarily complicated, because that's where we might
need a real 'Visual(Only)Position'.
2021-03-08 11:19:11 +01:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
tovl
84eb3c54ef Expose targetline colors to yaml.
All targetlines can now be set to a custom color in yaml or set to be invisible.
All automated behaviours including scripted activities now have no visible target lines.
2020-11-14 12:04:19 +00:00
abcdefg30
10f645bf77 Replace usage of the Stances dict by a method call 2020-11-14 11:04:41 +00:00
abcdefg30
eda9966d27 Rename Stance to PlayerRelationship 2020-11-14 11:04:41 +00:00
teinarss
13581c030d Use in parameter for Target 2020-11-06 22:02:24 +01:00
Paul Chote
e4faa6b0f0 Remove BuildingInfluence from Aircraft. 2020-10-26 16:51:12 +01:00
Paul Chote
5e032edd28 Remove redundant BuildingInfluence checks.
Buildings are already excluded by the ActorMap checks.
2020-10-26 16:51:12 +01:00
RoosterDragon
2adee1e374 Use HasMovementType to avoid Enum.HasFlag allocations. 2020-10-17 23:48:48 +02:00