Add a defining for AutoDeath on whether it can trigger when in Limbo state or as a passenger#2284
Add a defining for AutoDeath on whether it can trigger when in Limbo state or as a passenger#2284DeathFishAtEase wants to merge 15 commits into
Conversation
|
To Chinese users:
|
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
After more exploration, it was found that the original handling's support for objects in Limbo state was not complete (I previously thought #830 had handled this part, but it was actually support for LimboDelivery) and this leads to the fact that even if the implementation is completed, the two flags cannot be set to true by default, otherwise it will break existing behavior; this PR is shelved for now. |
|
In any case, supporting Limbo scenarios for more AutoDeath conditions is something that should have been done but has not been completed. This PR effectively fulfills the corresponding feature request, and passengers inside |
|
Tested by: https://www.phoboscn.top/t/topic/647/4?u=noble_fish [DRON]
AutoDeath.Behavior=kill
AutoDeath.AfterDelay=200
AutoDeath.AllowLimboed=no
[SQD]
AutoDeath.Behavior=kill
AutoDeath.AfterDelay=200
AutoDeath.AllowLimboed=no[E1]
AutoDeath.Behavior=kill
AutoDeath.OnOwnerChange=yes
AutoDeath.AllowLimboed=no
AutoDeath.AllowPassenger=no
[BFRT]
InitialPayload.Types=E1
InitialPayload.Nums=5
Passengers.SyncOwner=yes |
| // Self-destruction must be enabled | ||
| const auto howToDie = pTypeExt->AutoDeath_Behavior.Get(); | ||
|
|
||
| // You're already dead |
There was a problem hiding this comment.
Should comment specific design rationale
|
Should check if AutoDeath can still work when technos are in non-opentopped vehicles before merging. |
# Conflicts: # CREDITS.md # docs/Whats-New.md # src/Ext/Techno/Body.h # src/Ext/TechnoType/Body.h
925ce51 to
e95b7e2
Compare
e95b7e2 to
d8a63c3
Compare
| const bool isInLimbo = !pThis->IsInLogic && pThis->IsAlive; | ||
|
|
||
| if (pTypeExt->AutoDeath_Behavior.isset() && !(isInLimbo && !pTypeExt->AutoDeath_AllowLimboed.Get(RulesExt::Global()->AutoDeath_AllowLimboed)) && !(pThis->Transporter && !pTypeExt->AutoDeath_AllowPassenger.Get(RulesExt::Global()->AutoDeath_AllowPassenger))) | ||
| if (pTypeExt->AutoDeath_Behavior.isset()) |
There was a problem hiding this comment.
not sure if this should be removed as it'll still execute the line and set ShouldBeDead to true, which might make it die after leaving the transport


AutoDeath.AllowLimboedcan be used to define whether AutoDeath is triggered when the unit is in limbo state.AutoDeath.AllowPassengercan be used to define whether the unit triggers AutoDeath when it is a passenger.In
rulesmd.ini: