存修蜂巢断联
This commit is contained in:
Binary file not shown.
@@ -21,6 +21,10 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityPossess"/>
|
||||
<li Class="CompProperties_AbilityGiveHediff">
|
||||
<compClass>CompAbilityEffect_GiveHediff</compClass>
|
||||
<hediffDef>ARA_HiveMindDrone</hediffDef>
|
||||
</li>
|
||||
</comps>
|
||||
</AbilityDef>
|
||||
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
</disablesNeeds>
|
||||
</li>
|
||||
</stages>
|
||||
<comps>
|
||||
<li Class="HediffCompProperties_DisappearsOnDeath"/>
|
||||
</comps>
|
||||
</HediffDef>
|
||||
|
||||
</Defs>
|
||||
@@ -42,18 +42,7 @@ namespace ArachnaeSwarm
|
||||
{
|
||||
get
|
||||
{
|
||||
// Only remove if base ShouldRemove is true, OR if pawn is dead
|
||||
// We do NOT want to remove it just because target is invalid, as the Comp will handle delayed death
|
||||
if (base.ShouldRemove && pawn.Dead)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Also remove if pawn is no longer spawned or on a map
|
||||
if (!pawn.Spawned || pawn.Map == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false; // Let the Comp handle the unlinked death
|
||||
return this.pawn.Dead;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +50,7 @@ namespace ArachnaeSwarm
|
||||
{
|
||||
base.PostRemoved();
|
||||
// Deregister from the master when this hediff is removed
|
||||
// Ensure target is a Pawn and not dead before attempting to deregister
|
||||
if (this.target is Pawn master && master != null && !master.Destroyed && !master.Dead)
|
||||
if (this.target is Pawn master && master != null && !master.Destroyed)
|
||||
{
|
||||
var masterHediff = master.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("ARA_HiveMindMaster")) as Hediff_HiveMindMaster;
|
||||
masterHediff?.DeregisterDrone(this.pawn);
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace ArachnaeSwarm
|
||||
|
||||
public override string LabelInBrackets => drones.Count.ToString();
|
||||
|
||||
public override bool ShouldRemove => false;
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
|
||||
Reference in New Issue
Block a user