[CardTitles] Code optimizations

This commit is contained in:
RektInator 2017-05-30 18:38:54 +02:00
parent d77c74f5a9
commit 859f00acdd
2 changed files with 24 additions and 22 deletions

View File

@ -49,14 +49,14 @@ namespace Components
push esi; push esi;
push eax; push eax;
call GetPlayerCardClientInfo; call GetPlayerCardClientInfo;
add esp, 0x08; add esp, 8;
pop esi; pop esi;
pop ebp; pop ebp;
mov[ebx + 0x4], eax; mov[ebx + 4], eax;
pop ebx; pop ebx;
push 0x62EB2C; push 62EB2Ch;
retn; retn;
} }
} }
@ -65,23 +65,23 @@ namespace Components
{ {
__asm __asm
{ {
cmp byte ptr[edi + 0x01], 0xFF; // Check if skip prefix exists (edi + 0x00 = @) cmp byte ptr[edi + 01h], FFh; // Check if skip prefix exists (edi + 0x00 = @)
jne back; jne back;
add edi, 0x02; // Ignore the 0x40 and 0xFF prefix (Localize and Skip prefix) add edi, 2; // Ignore the 0x40 and 0xFF prefix (Localize and Skip prefix)
jmp jumpback; jmp jumpback;
back: back:
add edi, 0x01; add edi, 1;
push edi; push edi;
mov eax, 0x4F1700; mov eax, 4F1700h;
call eax; call eax;
add esp, 0x04; add esp, 4;
mov edi, eax; mov edi, eax;
jumpback: jumpback:
push 0x63A2E3; push 63A2E3h;
retn; retn;
} }
} }
@ -125,7 +125,7 @@ namespace Components
mov eax, title; mov eax, title;
pop ecx; pop ecx;
mov ecx, currentLookupRequest; mov ecx, currentLookupRequest;
mov ecx, DWORD ptr[ecx + 0x04]; mov ecx, DWORD ptr[ecx + 4];
retn; retn;
} }
} }
@ -143,7 +143,7 @@ namespace Components
mov eax, title; mov eax, title;
pop ecx; pop ecx;
mov ecx, currentLookupRequest; mov ecx, currentLookupRequest;
mov ecx, DWORD ptr[ecx + 0x04]; mov ecx, DWORD ptr[ecx + 4];
retn; retn;
} }
} }
@ -158,10 +158,10 @@ namespace Components
// Continue with the normal lookup request because we did not use our custom result // Continue with the normal lookup request because we did not use our custom result
__asm __asm
{ {
mov eax, [esi + 0x50]; mov eax, [esi + 50h];
cmp eax, 0x3; cmp eax, 3;
push 0x62DCC7; push 62DCC7h;
retn; retn;
} }
} }
@ -216,6 +216,6 @@ namespace Components
CardTitles::~CardTitles() CardTitles::~CardTitles()
{ {
CustomTitles.clear();
} }
} }

View File

@ -36,11 +36,11 @@ namespace Components
test al, al; test al, al;
jnz jumpback; jnz jumpback;
push 0x5944AE; push 5944AEh;
retn; retn;
jumpback: jumpback:
push 0x594536; push 594536h;
retn; retn;
} }
} }
@ -50,15 +50,15 @@ namespace Components
__asm __asm
{ {
mov lastServerCommand, ecx; mov lastServerCommand, ecx;
cmp ecx, 0x79; cmp ecx, 79h;
jl above; jl above;
push 0x59449F; push 59449Fh;
retn; retn;
above: above:
push 0x593C28; push 593C28h;
retn; retn;
} }
} }
@ -78,9 +78,11 @@ namespace Components
{ {
__asm __asm
{ {
pushad;
call OnServerCommandFailPrint; call OnServerCommandFailPrint;
popad;
push 0x5944C0; push 5944C0h;
retn; retn;
} }
} }
@ -98,6 +100,6 @@ namespace Components
ServerCommands::~ServerCommands() ServerCommands::~ServerCommands()
{ {
Commands.clear();
} }
} }