Skip to content

Commit

Permalink
Support spawning vanilla gases from explosive projectile detonation
Browse files Browse the repository at this point in the history
Add support for the postExplosionGasType XML tag in
CompProperties_ExplosiveCE, which allows our explosive projectiles to
spawn a built-in gas type on detonation. We seem to be already using it
in XML, the code just was not ready to use it.
  • Loading branch information
mszabo-wikia committed Oct 29, 2022
1 parent 9d0ef48 commit 618d133
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/CombatExtended/CombatExtended/Comps/CompExplosiveCE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public virtual void Explode(Thing instigator, Vector3 pos, Map map, float scaleF
Props.postExplosionSpawnThingDef,
Props.postExplosionSpawnChance,
Props.postExplosionSpawnThingCount,
postExplosionGasType: null,
Props.postExplosionGasType,
Props.applyDamageToExplosionCellsNeighbors,
Props.preExplosionSpawnThingDef,
Props.preExplosionSpawnChance,
Expand All @@ -67,4 +67,4 @@ public virtual void Explode(Thing instigator, Vector3 pos, Map map, float scaleF
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class CompProperties_ExplosiveCE : CompProperties
public bool damageFalloff = true;
public float chanceToStartFire;

/// <summary>
/// The type of built-in core game gas to spawn on detonation.
/// </summary>
public GasType? postExplosionGasType;

public CompProperties_ExplosiveCE()
{
compClass = typeof(CompExplosiveCE);
Expand Down

0 comments on commit 618d133

Please sign in to comment.