From 1e6b887ef96e2338ac73bdc5c5197f86fc7ef953 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:15:48 +0200 Subject: [PATCH] small things --- src/game_api/drops.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game_api/drops.cpp b/src/game_api/drops.cpp index 71acb984d..bc76a9865 100644 --- a/src/game_api/drops.cpp +++ b/src/game_api/drops.cpp @@ -383,7 +383,6 @@ void replace_drop(int32_t drop_id, ENT_TYPE new_drop_entity_type) { auto memory = Memory::get(); size_t offset = 0; - size_t exe_offset = 0; const auto drop_name{"DROP." + entry.caption}; if (entry.vtable_offset == VTABLE_OFFSET::NONE) @@ -397,15 +396,15 @@ void replace_drop(int32_t drop_id, ENT_TYPE new_drop_entity_type) int x = 0; do { - offset = find_inst(memory.exe(), entry.pattern, offset + 1, std::nullopt, drop_name); + offset = find_inst(memory.exe(), entry.pattern, offset, std::nullopt, drop_name); if (offset == 0) return; - exe_offset = memory.at_exe(offset + entry.value_offset); - entry.offsets[x] = exe_offset; + entry.offsets[x] = memory.at_exe(offset + entry.value_offset); + offset += entry.pattern.size(); ++x; - } while (x < entry.vtable_occurrence); + } while (x < entry.vtable_occurrence && x < 3); } if (entry.offsets[0] != 0)