forked from kyx0r/FA-Binary-Patches
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative fix for the toggle of the Salem (#94)
Depends on: FAForever/fa#6499
- Loading branch information
Showing
7 changed files
with
70 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#define SECTION(index, address) ".section h"#index"; .set h"#index","#address";" | ||
#include "../define.h" | ||
|
||
asm( | ||
// Moho::Entity::Entity | ||
SECTION(0, 0x00677BC9) | ||
"mov dword ptr [esi+0x1F8], ebx;" // 0x1F9 bool forceAltFootprint | ||
// Moho::Entity::GetFootprint | ||
SECTION(1, 0x006788A5) | ||
"jmp "QU(asm__GetFootprint)";" | ||
"nop;" | ||
"nop;" | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "include/CObject.h" | ||
#include "include/magic_classes.h" | ||
#include "include/moho.h" | ||
|
||
int ForceAltFootPrint(lua_State *L) | ||
{ | ||
|
||
if (lua_gettop(L) != 2) | ||
L->LuaState->Error(s_ExpectedButGot, __FUNCTION__, 2, lua_gettop(L)); | ||
auto res = GetCScriptObject<Unit>(L, 1); | ||
if (res.IsFail()) | ||
L->LuaState->Error("%s", res.reason); | ||
|
||
void *unit = res.object; | ||
bool flag = lua_toboolean(L, 2); | ||
|
||
GetField<bool>(unit, 8+0x1F9) = flag; // bool forceAltFootprint | ||
|
||
return 0; | ||
} | ||
using UnitMethodReg = SimRegFunc<0x00E2D550, 0x00F8D704>; | ||
|
||
UnitMethodReg UseAltFootPrintReg{ | ||
"ForceAltFootPrint", | ||
"", | ||
ForceAltFootPrint, | ||
"Unit"}; | ||
|
||
|
||
void asm__GetFootprint() | ||
{ | ||
asm( | ||
"cmp byte ptr [ecx+0x11C], 0;" // this->sstiData.usingAltFp | ||
"jnz 0x006788AE;" | ||
"cmp byte ptr [ecx+0x1F9], 0;" // bool forceAltFootprint | ||
"jnz 0x006788AE;" | ||
"jmp 0x006788C2;" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.