diff --git a/source/main/physics/ActorSpawner.cpp b/source/main/physics/ActorSpawner.cpp index ceed2c060d..688ab3c169 100644 --- a/source/main/physics/ActorSpawner.cpp +++ b/source/main/physics/ActorSpawner.cpp @@ -116,6 +116,8 @@ void ActorSpawner::ConfigureAddonParts(CacheEntryPtr& tuneup_entry) ROR_ASSERT(tuneup_entry->resource_group != ""); ROR_ASSERT(tuneup_entry->tuneup_def != nullptr); + AddonPartUtility::ResetUnwantedAndTweakedElements(tuneup_entry->tuneup_def); + for (const std::string& addonpart: tuneup_entry->tuneup_def->use_addonparts) { CacheEntryPtr addonpart_entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, addonpart); diff --git a/source/main/resources/addonpart_fileformat/AddonPartFileFormat.cpp b/source/main/resources/addonpart_fileformat/AddonPartFileFormat.cpp index 7d7e3a9b5f..ac64d1f177 100644 --- a/source/main/resources/addonpart_fileformat/AddonPartFileFormat.cpp +++ b/source/main/resources/addonpart_fileformat/AddonPartFileFormat.cpp @@ -152,6 +152,17 @@ void AddonPartUtility::ResolveUnwantedAndTweakedElements(TuneupDefPtr& tuneup, C } } +void AddonPartUtility::ResetUnwantedAndTweakedElements(TuneupDefPtr& tuneup) +{ + ROR_ASSERT(tuneup); + // Unwanted + tuneup->remove_flexbodies.clear(); + tuneup->remove_props.clear(); + // Tweaked + tuneup->node_tweaks.clear(); + tuneup->wheel_tweaks.clear(); +} + // Helpers of `TransformToRigDefModule()`, they expect `m_context` to be in position: // These expect `m_context` to be in position: diff --git a/source/main/resources/addonpart_fileformat/AddonPartFileFormat.h b/source/main/resources/addonpart_fileformat/AddonPartFileFormat.h index 71d85723f4..bd44c6bd8c 100644 --- a/source/main/resources/addonpart_fileformat/AddonPartFileFormat.h +++ b/source/main/resources/addonpart_fileformat/AddonPartFileFormat.h @@ -50,6 +50,8 @@ class AddonPartUtility /// Also handles 'addonpart_tweak_*' elements, resolving possible conflicts among used parts. void ResolveUnwantedAndTweakedElements(TuneupDefPtr& tuneup, CacheEntryPtr& addonpart_entry); + static void ResetUnwantedAndTweakedElements(TuneupDefPtr& tuneup); + private: // Helpers of `TransformToRigDefModule()`, they expect `m_context` to be in position: void ProcessManagedMaterial();