Skip to content

Commit

Permalink
small things
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Auto committed Sep 27, 2023
1 parent e7d79c8 commit 1e6b887
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/game_api/drops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 1e6b887

Please sign in to comment.