From 68119b017b3d4a63b64f63cd914e1d61ac4ad88a Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Fri, 6 Sep 2024 08:22:48 +0100 Subject: [PATCH] moved to ProjectileProps --- Defs/Ammo/Pistols/45ACP.xml | 10 +++++----- .../CombatExtended/CombatExtended/AmmoGeneralizer.cs | 2 +- Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs | 2 -- .../Projectiles/ProjectilePropertiesCE.cs | 2 ++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Defs/Ammo/Pistols/45ACP.xml b/Defs/Ammo/Pistols/45ACP.xml index 333348bb1c..cb39fc6013 100644 --- a/Defs/Ammo/Pistols/45ACP.xml +++ b/Defs/Ammo/Pistols/45ACP.xml @@ -97,7 +97,7 @@ - + Things/Projectile/Bullet_Small Graphic_Single @@ -108,11 +108,11 @@ true Fleck_PistolAmmoCasings Filth_PistolAmmoCasings + pistol - pistol - + Bullet_45ACP_FMJ @@ -122,7 +122,7 @@ - + Bullet_45ACP_AP @@ -132,7 +132,7 @@ - + Bullet_45ACP_HP diff --git a/Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs b/Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs index 9a2d302dbb..7f1f1f674b 100644 --- a/Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs +++ b/Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs @@ -30,7 +30,7 @@ static AmmoGeneralizer() var sameClass = ammoSource.ammoTypes.Find(x => x.ammo.ammoClass == link.ammo.ammoClass); if (sameClass != null) { - string labelNew = (link.projectile is AmmoDef ammodef && ammodef.genericLabelOverride != null) ? ammodef.genericLabelOverride : ammoSource.label; + string labelNew = (link.projectile.projectile is ProjectilePropertiesCE projPropCE && projPropCE.genericLabelOverride != null) ? projPropCE.genericLabelOverride : ammoSource.label; link.projectile.label = labelNew + " " + "CE_GenericBullet".Translate() + " (" + link.ammo.ammoClass.labelShort + ")"; newAmmos.Add(new AmmoLink { ammo = sameClass.ammo, projectile = link.projectile }); } diff --git a/Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs b/Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs index 377f23e70f..bd80bc59a0 100644 --- a/Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs +++ b/Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs @@ -20,8 +20,6 @@ public class AmmoDef : ThingDef public SoundDef cookOffSound = null; public SoundDef cookOffTailSound = null; public ThingDef detonateProjectile = null; - [MustTranslate] - public string genericLabelOverride = null; // mortar ammo should still availabe when the ammo system is off public bool isMortarAmmo = false; diff --git a/Source/CombatExtended/CombatExtended/Projectiles/ProjectilePropertiesCE.cs b/Source/CombatExtended/CombatExtended/Projectiles/ProjectilePropertiesCE.cs index 3a55f3ae30..2fc86e8742 100644 --- a/Source/CombatExtended/CombatExtended/Projectiles/ProjectilePropertiesCE.cs +++ b/Source/CombatExtended/CombatExtended/Projectiles/ProjectilePropertiesCE.cs @@ -39,6 +39,8 @@ public class ProjectilePropertiesCE : ProjectileProperties public ThingDef detonateMoteDef; public FleckDef detonateFleckDef; public float detonateEffectsScaleOverride = -1; + [MustTranslate] + public string genericLabelOverride = null; #region Bunker Buster fields ///