From f230f31696111351996dade6558b0bb22d5a4062 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:09:13 +0100 Subject: [PATCH] fix entity names for "Detect Entities" button --- src/QtHelpers/ItemModelVirtualTable.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/QtHelpers/ItemModelVirtualTable.cpp b/src/QtHelpers/ItemModelVirtualTable.cpp index 11507d8f..ce660724 100644 --- a/src/QtHelpers/ItemModelVirtualTable.cpp +++ b/src/QtHelpers/ItemModelVirtualTable.cpp @@ -1,5 +1,6 @@ #include "QtHelpers/ItemModelVirtualTable.h" #include "Configuration.h" +#include "Data/Entity.h" #include "Data/State.h" #include "Data/VirtualTableLookup.h" #include "Spelunky2.h" @@ -99,11 +100,10 @@ void S2Plugin::ItemModelVirtualTable::detectEntities() for (auto x = 0; x < maximum; ++x) { auto entityPtr = layerEntities + (x * sizeof(size_t)); - auto entity = Script::Memory::ReadQword(entityPtr); - auto entityVTableOffset = Script::Memory::ReadQword(entity); + Entity entity = Script::Memory::ReadQword(entityPtr); + auto entityVTableOffset = Script::Memory::ReadQword(entity.ptr()); - // auto entityUid = Script::Memory::ReadDword(entity + 56); - auto entityName = Configuration::get()->getEntityName(entity); + auto entityName = entity.entityTypeName(); Spelunky2::get()->get_VirtualTableLookup().setSymbolNameForOffsetAddress(entityVTableOffset, entityName); } };