From 76355fc65bc3f29986ca20501ac84a1d9c595d67 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Tue, 24 Oct 2023 13:40:56 +0100 Subject: [PATCH] Update Building_TurretGunCE.cs --- .../CombatExtended/Things/Building_TurretGunCE.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs b/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs index 9aeaa9629d..e16f9d42b6 100644 --- a/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs +++ b/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs @@ -200,8 +200,8 @@ public override void SpawnSetup(Map map, bool respawningAfterLoad) //Add ma TurretDrawExtension turretDrawExtension = this.def.GetModExtension(); if (turretDrawExtension != null) { - TurretTopBaseMaterial = turretDrawExtension.TurretBottomGraphicData.Graphic.MatSingle; - TurretTopTopMaterial = turretDrawExtension.TurretTopGraphicData.Graphic.MatSingle; + TurretTopBaseMaterial = turretDrawExtension.TurretBottomGraphicData?.Graphic.MatSingle; + TurretTopTopMaterial = turretDrawExtension.TurretTopGraphicData?.Graphic.MatSingle; if (turretDrawExtension.Barrels.Any()) { foreach (var barrel in turretDrawExtension.Barrels) @@ -648,7 +648,7 @@ public void DrawTurretComponents(Material mat, bool above = false) public void DrawTurretComponentRecoiled(Material mat, Vector2 offset, Vector3 recoilDrawOffset, float recoilAngleOffset) { float turretTopDrawSize = def.building.turretTopDrawSize; - Vector3 v = recoilDrawOffset.RotatedBy(recoilAngleOffset); + Vector3 v = recoilDrawOffset; float num = CurrentEffectiveVerb?.AimAngleOverride ?? top.CurRotation; Matrix4x4 matrix = default(Matrix4x4); matrix.SetTRS(DrawPos + Altitudes.AltIncVect + v + new Vector3(offset.x, 0f, offset.y).RotatedBy(top.CurRotation), (-90 + num).ToQuat(), new Vector3(turretTopDrawSize, 1f, turretTopDrawSize));