From ee0b3b7df2afec8f5dfca50fdbcb0af7dc45f45d Mon Sep 17 00:00:00 2001 From: Zero Fanker Date: Tue, 20 Oct 2026 22:27:59 -0400 Subject: [PATCH] Fix: make building turret facing compatible to RN's loop end control . --- FA2sp/Ext/CLoading/Body.LoadObjects.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/FA2sp/Ext/CLoading/Body.LoadObjects.cpp b/FA2sp/Ext/CLoading/Body.LoadObjects.cpp index 12f8398a..940a2f4c 100644 --- a/FA2sp/Ext/CLoading/Body.LoadObjects.cpp +++ b/FA2sp/Ext/CLoading/Body.LoadObjects.cpp @@ -1022,7 +1022,15 @@ void CLoadingExt::LoadBuilding_Normal(const FString& ID, bool loadAsGarrisonDama FString TurName = Variables::RulesMap.GetString(ID, "TurretAnim", ID + "TUR"); int nStartFrame = CINI::Art->GetInteger(TurName, "LoopStart"); bool shadow = bHasShadow && CINI::Art->GetBool(TurName, "Shadow", true) && ExtConfigs::InGameDisplay_Shadow; - int actualFacings = CINI::Art->GetInteger(TurName, "Facings", 32); + int actualFacings = 0; + if (CINI::Art->KeyExists(TurName, "LoopEnd")) + { + actualFacings = CINI::Art->GetInteger(TurName, "LoopEnd") - nStartFrame; + } + if (actualFacings <= 0) + { + actualFacings = CINI::Art->GetInteger(TurName, "Facings", 32); + } int idleFrames = Variables::RulesMap.GetInteger(ID, "TurretAnim.IdleFrames", 1); bool hasBarl = false; @@ -1549,7 +1557,15 @@ void CLoadingExt::LoadBuilding_Damaged(const FString& ID, bool loadAsRubble) ID + "TUR"); int nStartFrame = CINI::Art->GetInteger(TurName, "LoopStart"); bool shadow = bHasShadow && CINI::Art->GetBool(TurName, "Shadow", true) && ExtConfigs::InGameDisplay_Shadow; - int actualFacings = CINI::Art->GetInteger(TurName, "Facings", 32); + int actualFacings = 0; + if (CINI::Art->KeyExists(TurName, "LoopEnd")) + { + actualFacings = CINI::Art->GetInteger(TurName, "LoopEnd") - nStartFrame; + } + if (actualFacings <= 0) + { + actualFacings = CINI::Art->GetInteger(TurName, "Facings", 32); + } int idleFrames = Variables::RulesMap.GetInteger(ID, "TurretAnim.IdleFrames", 1); bool hasBarl = false;