From ee8bbc19173d0e845e5d6a9a2e0902cc8f4c61e0 Mon Sep 17 00:00:00 2001 From: DeathWrench <45341450+DeathWrench@users.noreply.github.com> Date: Wed, 6 Aug 2025 13:45:54 -0400 Subject: [PATCH] Fix (https://github.com/bananaturtlesandwich/stove/issues/37) --- unreal_asset/unreal_asset_base/src/types/fname.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/unreal_asset/unreal_asset_base/src/types/fname.rs b/unreal_asset/unreal_asset_base/src/types/fname.rs index 5da3169..c4ac7f7 100644 --- a/unreal_asset/unreal_asset_base/src/types/fname.rs +++ b/unreal_asset/unreal_asset_base/src/types/fname.rs @@ -141,7 +141,19 @@ impl FName { /// Get this `FName`'s content as a `String` pub fn get_owned_content(&self) -> String { - self.get_content(str::to_string) + // Get access to this `FName`'s content as a string, along with it's instance number + let name = self.get_content(str::to_string); + let number = self.get_number(); + + // If the instance number is 0, just return the content string + // If the instance number is not 0, return the content string along with the instance index + if number == 0 { + name.clone() + } + else { + let instanceIndex = number - 1; + name.clone() + "_" + &instanceIndex.to_string() + } } /// Checks if an `FName`'s content ends with the given `&str`