Commit Graph

36 Commits

Author SHA1 Message Date
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
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
Matthias Mailänder
aa14c9c570 Add VTOL landing exhaust animation. 2022-08-12 00:54:44 +03:00
Matthias Mailänder
1073a7124f Remove an unused field from TakeOff.cs 2022-08-12 00:54:44 +03:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
Andre Mohren
006a87692a Removed unused imports. 2020-07-28 18:22:51 +02:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
tovl
145b6a05a3 Refactor unreserve actions. 2019-09-26 18:39:44 +02:00
tovl
5787f74af9 Prevent bogus attackmove on take-off. 2019-09-26 18:39:44 +02:00
tovl
70459b311e Refactor FlyAttack to make strafing runs interruptible when target becomes invalid. 2019-08-18 12:50:20 +02:00
Paul Chote
78302ea593 Rework aircraft rally point handling. 2019-08-15 17:02:27 +02:00
tovl
c0d5cd750d Add missing target lines. 2019-08-10 12:17:36 +02:00
reaperrr
cf4d73ab91 Revert FlightDynamics
This needs more thought and most parts might get superseded
by other approaches.

Kept CanSlide separation from CanHover.
2019-07-18 10:26:43 +02:00
reaperrr
0ebeb30880 Replace various Aircraft fields with FlightDynamics
Replaces various booleans with a FlightDynamics flag list.
2019-07-05 00:03:36 +02:00
tovl
3790169db9 Make Tick return bool 2019-07-03 20:42:19 +02:00
tovl
b9c302a73a Move ChildActivity handling into base Activity class. 2019-07-03 20:42:19 +02:00
tovl
79a48765d9 Allow VTOLs to land with force-move 2019-06-30 18:04:43 +02:00
reaperrr
8589e26dc2 Resolve rally point target on first run. 2019-06-07 22:18:33 +01:00
reaperrr
ce3d7c98ad Refactor TakeOff
- Make it self-contained by moving actual take-off
  from 'Fly' to this
- Make 'moveToRallyPoint' a simple boolean
- Make AttackMove to rally point a child activity
- Make TakeOff uninterruptible
2019-06-07 22:18:33 +01:00
tovl
64cec4a0ad Revise AttackMoveActivity. 2019-03-22 19:02:05 +01:00
Oliver Brakmann
0ee9219df3 Fix unresponsive aircraft when executing orders queued during resupply 2019-02-06 18:01:51 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Jean-Rémy Buchs
1d1802a163 Add LandOnCondition to the trait Aircraft which triggers a landing and prevents takeoffs while the condition is met 2017-08-08 15:13:50 -05:00
Oliver Brakmann
e49b3d6458 Adjust existing activities for changed NextActivity semantics
To make sure existing checks against NextActivity don't check the parent activity by mistake
2017-01-22 20:41:37 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Oliver Brakmann
fb1f8c4e01 Remove brain-dead logic from TakeOff
1. TakeOff's Tick() method never checks itself whether it is canceled
2. If NextActivity is null, TakeOff is the only activity on the queue
3. Takeoff canceling the queue then just cancels itself, with no effect at all

4. If Takeoff however is running as an inner activity, it will cancel the complete main queue, wrecking all sorts of havoc
2016-09-05 19:20:51 +02:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
RoosterDragon
e2dd967757 Fix some reservation issues.
- TakeOff.Tick was nulling a local variable, rather than the Reservation field - this is changed to call UnReserve which does the right thing.
- Aircraft.ResolveOrder was missing an UnReserve call before setting a new reservation.
2015-10-27 22:00:26 +00:00
atimoschenkow
b1c51cc910 Fix for #6161 queue commands for Plane/Heli (do not ignore Order.Queued in ResolveOrder()) 2015-08-07 23:41:03 +02:00
reaperrr
1e9d1a6cb7 Cache trait look-ups in the constructor where possible for Air activities/traits 2015-03-27 13:47:04 +01:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
reaperrr
654f56c5d5 Moves Attack, Armament, Move, Air traits and activities as well as anything required by them to Mods.Common.
Extracts Exit from Production into its own trait.
2015-01-04 05:24:28 +01:00