Commit Graph

69 Commits

Author SHA1 Message Date
Oliver Brakmann
9993a235a7 Convert ResupplyAircraft into a CompositeActivity 2017-01-22 20:42:19 +01:00
Oliver Brakmann
9b0780e87c Make FlyAttack use child activities 2017-01-22 20:41:41 +01: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
Paul Chote
9ddfdc45b3 Introduce SoundType enum. 2016-12-23 11:34:23 +00:00
Oliver Brakmann
2c66ee8c13 Add native support for uninterruptible activities
This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
2016-10-31 18:46:27 +01:00
abcdefg30
55143ced87 Fix HeliReturnToBase not exposing an host actor parameter 2016-10-03 14:56:52 +02:00
Paul Chote
34b10dcb77 Hack around the Lua API. 2016-09-26 17:48:25 +01:00
Paul Chote
ea65ac542e Add AbortOnResupply property to cancel aircraft activities on resupply. 2016-09-25 15:57:17 +01:00
Paul Chote
eeaa461311 Avoid landing-dances when issuing mixed full/empty aircraft RTB orders. 2016-09-25 15:57:16 +01:00
Oliver Brakmann
852d947764 Fix setting MayYieldReservation when there is no reservation 2016-09-15 21:10:47 +02:00
Oliver Brakmann
9fbda6b598 Fix helicopters not taking off when their target got covered by shroud 2016-09-12 23:01:16 +02:00
Oliver Brakmann
daa1f16e98 Prevent an infinite loop when planes go out of ammo and all airfields are gone 2016-09-05 19:59:01 +02:00
Oliver Brakmann
351c231693 Use the yield reservation logic for helicopters as well. Oops. 2016-09-05 19:24:26 +02: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
Oliver Brakmann
7f64495d6f Make aircraft continue attack on same target after re-arming 2016-09-04 21:31:05 +02:00
Oliver Brakmann
e7d07e5a01 Fix FlyAttack not calling TakeOff for landed aircraft 2016-09-04 21:31:05 +02:00
Oliver Brakmann
6d15406ffe Fix aircraft reservation madness 2016-09-04 21:31:05 +02:00
Matthias Mailänder
020b0e628e Merge pull request #11871 from pchote/fix-production-circle
Remove hardcoded constants from Fly and ProductionAirdrop.
2016-08-27 19:43:15 +02:00
Paul Chote
1ae86f34f8 Overhaul Carryall behaviour, adding support for manual control. 2016-08-27 15:42:18 +01:00
Paul Chote
06ca8b6cf2 Remove hardcoded constant from Fly. 2016-08-24 17:20:07 +01:00
PedroFerreiraRamos
958e35d61f Fix air unit resupply #5966 2016-07-12 20:17:45 -03:00
reaperrr
40e5dfbedb Fix helicopters not returning when all valid weapons are out of ammo
They now return if all weapons are invalid (which includes those that are otherwise valid, but out of ammo) and at least one AmmoPool needs reloading at RearmBuilding.
2016-06-23 14:47:42 +02:00
reaperrr
4f55b088eb Check if weapon without self-reloading is out of ammo when deciding validity
This should prevent attacking helicopters (or other actors) staying at the range to target of a weapon that is out of ammo and needs manual reloading at a RearmBuilding or via upgrades.
2016-06-23 14:47:41 +02:00
reaperrr
2f1a6e8807 Add maximum and minimum range vs. target checks
This adresses the issue that actors would ignore the validity of weapons when deciding the attack distance versus a target. This could result in actors staying out of range of a weapon valid versus target if they carried a weapon with higher range but invalid versus target.
2016-06-16 20:39:45 +02:00
reaperrr
73ec1ec9b2 Remove float from ReturnToBase.CalculateTurnRadius
141 / PI ~= 44.88, so 45 should be accurate enough. This should reduce desync risk while improving performance of this calculation.
2016-03-28 17:20:49 +02:00
reaperrr
cddf182996 Renamed ROT to TurnSpeed on Mobile, Aircraft, Turreted and ThrowsParticle 2016-03-04 15:13:55 +01: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
PedroFerreiraRamos
bf97dd6b7b Bug fix #10029 Plane resupply 2016-02-19 08:35:18 -02:00
Paul Chote
0039a2bdbf Split out an ActivityUtils class. 2016-01-19 23:34:13 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Paul Chote
3b18c7815d Remove Util.GetFacing. 2016-01-16 22:38:17 +00:00
abcdefg30
07bfd5f59e Merge pull request #9786 from RoosterDragon/reserve-fixes
Reserve fixes
2015-12-01 21:13:41 +01:00
teees
c9e5dba38b Fixed FallToEarth groundlevel check 2015-11-30 13:02:16 +01:00
atlimit8
b6f17df260 Add ActorsHavingTrait<TTrait>([Func<TTrait, bool]) 2015-10-28 16:36:45 -05:00
RoosterDragon
b4180615a8 Add Aircraft.MakeReservation.
This provides a simpler method for making reservations and also ensures the previous reservation is definitely unreserved before being discarded.
2015-10-27 22:15:56 +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
atlimit8
49d7604bd9 Cache WeaponInfo look-ups 2015-10-03 22:29:40 -05:00
Pavel Penev
0ee38de4bb Rename HeliReturn
Rename HeliReturn to HeliReturnToBase to keep somewhat with the convention established for Plane- against Heli- oriented traits.
2015-10-01 20:15:50 +03:00
Pavel Penev
8a44366667 Merge Plane and Helicopter into Aircraft 2015-10-01 20:15:41 +03:00
Pavel Penev
0ee1ad3fa4 Add a default value to ReturnToBase's constructor for non-Lua usages 2015-10-01 20:09:16 +03:00
atlimit8
9acf121eb1 Replace ActorInfo.Traits.WithInterface with ActorInfo.TraitInfos<T>() 2015-09-21 15:50:57 -05:00
Paul Chote
ef55d646f7 Unstatic the Sound class. 2015-09-20 14:11:06 +01:00
atlimit8
09984683a7 Add ActorInfo.TraitInfo[OrDefault]<T>() requiring ITraitIfo types 2015-09-19 09:56:14 -05:00
atlimit8
6970959ef1 .Trait[OrDefault]<Trait> => .Info.Traits.Get[OrDefault]<TraitInfo> where applicable 2015-09-19 09:49:24 -05:00
atlimit8
8162fa27ab Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types 2015-09-19 09:49:24 -05:00
atlimit8
85fab45451 Remove Actor.HasTrait<T>() 2015-09-19 09:49:23 -05:00
Pavel Penev
71c5d69dc5 Merge pull request #8938 from abcdefg30/heliheigth
Have flying actors account for terrain height
2015-08-17 13:53:39 +03:00
abcdefg30
15f22c32b3 Merge pull request #8886 from atimoschenkow/fly-queue
Fix queue commands for Plane/Heli
2015-08-12 00:50:43 +02:00