From 56e4955c549c62b783ee639204ef1fa803204ca2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 21 Mar 2024 15:22:53 -0400 Subject: [PATCH] Fix struct parsing using multiple methods to re-read a single member --- CHANGELOG.md | 3 ++- src/core/parseutil.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c328f96..0f97e933 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp The **"Breaking Changes"** listed below are changes that have been made in the decompilation projects (e.g. pokeemerald), which porymap requires in order to work properly. It also includes changes to the scripting API that may change the behavior of existing porymap scripts. If porymap is used with a project or API script that is not up-to-date with the breaking changes, then porymap will likely break or behave improperly. ## [Unreleased] -Nothing, yet. +### Fixed +- Fix object event sprites not loading for some struct data formats. ## [5.4.0] - 2024-02-13 ### Added diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index cee1dd5f..8af1bf2b 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -568,7 +568,7 @@ QMap> ParseUtil::readCStructs(const QString &fi values.insert(key, value); } else { // For compatibility with structs that don't specify member names. - if (memberMap.contains(i)) + if (memberMap.contains(i) && !values.contains(memberMap.value(i))) values.insert(memberMap.value(i), QString::fromStdString(v.string_value())); } i++;