From 409ceece3deadcb419aee914a8421e90296164cc Mon Sep 17 00:00:00 2001 From: julee Date: Fri, 29 Oct 2021 10:51:14 +0800 Subject: [PATCH] Fixed enum to wrong string cause by misuse GetNameStringByValue and GetNameStringByIndex --- .../Plugins/Carla/Source/Carla/Actor/CarlaBlueprintRegistry.cpp | 2 +- .../Plugins/Carla/Source/Carla/MapGen/CityMapMeshTag.cpp | 2 +- .../Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaBlueprintRegistry.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaBlueprintRegistry.cpp index fb660a59a..0ed75377e 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaBlueprintRegistry.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaBlueprintRegistry.cpp @@ -33,7 +33,7 @@ static FString PropSizeTypeToString(EPropSize PropSizeType) { return FString("unknown"); } - return ptr->GetNameStringByIndex(static_cast(PropSizeType)); + return ptr->GetNameStringByValue(static_cast(PropSizeType)); } static EPropSize StringToPropSizeType(FString PropSize) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/CityMapMeshTag.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/CityMapMeshTag.cpp index 1ee7916fb..7c20af1e9 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/CityMapMeshTag.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/CityMapMeshTag.cpp @@ -26,5 +26,5 @@ FString CityMapMeshTag::ToString(ECityMapMeshTag Tag) const UEnum* ptr = FindObject(ANY_PACKAGE, TEXT("ECityMapMeshTag"), true); if(!ptr) return FString("Invalid"); - return ptr->GetNameStringByIndex(static_cast(Tag)); + return ptr->GetNameStringByValue(static_cast(Tag)); } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp index 0d3c7fc6f..a67bd03a8 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp @@ -57,7 +57,7 @@ FString QualityLevelToString(EQualityLevel QualitySettingsLevel) { return FString("Invalid"); } - return ptr->GetNameStringByIndex(static_cast(QualitySettingsLevel)); + return ptr->GetNameStringByValue(static_cast(QualitySettingsLevel)); } static void LoadSettingsFromConfig(