Skip to content

Commit

Permalink
Add casing throwing to vehicle turrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Keshash committed Sep 22, 2023
1 parent b33e5fb commit 37d7348
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/VehiclesCompat/VehiclesCompat/VehiclesCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ public static object LaunchProjectileCE(ThingDef projectileDef,
}
var p = ThingMaker.MakeThing(projectileDef, null);
ProjectileCE projectile = (ProjectileCE)p;

var projectilePropsCE = projectileDef.projectile as ProjectilePropertiesCE;
if (projectilePropsCE.dropsCasings)
{
CE_Utility.ThrowEmptyCasing(vehicle.DrawPos, vehicle.Map, DefDatabase<FleckDef>.GetNamed(projectilePropsCE.casingMoteDefname), 3f, shotRotation);
CE_Utility.MakeCasingFilth(vehicle.Position, vehicle.Map, DefDatabase<ThingDef>.GetNamed(projectilePropsCE.casingFilthDefname));
}

GenSpawn.Spawn(projectile, vehicle.Position, vehicle.Map);
projectile.ExactPosition = origin;
projectile.canTargetSelf = false;
Expand Down

0 comments on commit 37d7348

Please sign in to comment.