Skip to content

Commit

Permalink
immediately tick fragments when spawning them
Browse files Browse the repository at this point in the history
  • Loading branch information
logan committed Jan 20, 2025
1 parent d6f775b commit e7dfc3b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/CombatExtended/CombatExtended/Comps/CompFragments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static IEnumerator FragRoutine(Vector3 pos, Map map, float height, Thing
projectile.logMisses = false;
float elevAngle = Mathf.Asin(fragAngleSinRange.RandomInRange);


projectile.Launch(
instigator,
exactOrigin,
Expand All @@ -65,8 +64,10 @@ public static IEnumerator FragRoutine(Vector3 pos, Map map, float height, Thing
fragSpeedFactor * projectile.def.projectile.speed,
projectile
);

projectile.castShadow = (Rand.Value < fragShadowChance); // moved after Launch due to it assigning shadow

projectile.Tick(); // fragments often impact something immediately, so this culls them before they need to filter out other fragments

fragSpawnedInTick++;
if (fragSpawnedInTick >= fragPerTick)
Expand Down

0 comments on commit e7dfc3b

Please sign in to comment.