Skip to content

Commit

Permalink
Remove duped code
Browse files Browse the repository at this point in the history
  • Loading branch information
EddieEldridge committed Sep 30, 2024
1 parent d254ca7 commit 4569d86
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions M2TWEOP Code/M2TWEOP library/Injects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8756,42 +8756,4 @@ void toRetreat::SetNewCode()
m_cheatBytes = (unsigned char*)a->make();

delete a;
}

sizeOfBattleField::sizeOfBattleField(MemWork* mem, UINT32 gamever, float sizeX, float sizeY)
:AATemplate(mem), sizeX(sizeX), sizeY(sizeY)
{
if (gamever == 1)//disk ver
m_adress = 0x00441335;
else if (gamever == 2)//steam ver
m_adress = 0x00441675;
}

sizeOfBattleField::~sizeOfBattleField()
{
}

void sizeOfBattleField::SetOriginalSizeCode()
{
Assembler* a = new Assembler();
a->mov(ecx, dword_ptr(eax, 0x00000080));
a->ret();
m_originalBytes = (unsigned char*)a->make();
m_originalSize = m_memory->GetASMSize(m_originalBytes);

delete a;
}

void sizeOfBattleField::SetlSizeCode()
{
Assembler* a = new Assembler();
a->mov(dword_ptr(eax, 0x00000080), *(reinterpret_cast<int*>(&sizeX)));
a->mov(dword_ptr(eax, 0x0000007C), *(reinterpret_cast<int*>(&sizeY)));


a->mov(ecx, dword_ptr(eax, 0x00000080));
a->ret();
m_cheatBytes = (unsigned char*)a->make();

delete a;
}
}

0 comments on commit 4569d86

Please sign in to comment.