Skip to content

Commit

Permalink
Do not create new table in SelectUnits (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
4z0t authored Oct 4, 2024
1 parent 80c1e9f commit f6abd5e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ These don't matter except for other assembly patches
* Sim
* EntityCategoryFilterDown
- hooks/TableInsertFix.cpp
- Remove result table in `SelectUnits`
- hooks/SelecUnitsTableFix.cpp

## Bugs
- Remove lingering transport load factor calcuation at aircraft initialization
Expand Down
41 changes: 41 additions & 0 deletions hooks/SelecUnitsTableFix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#define SECTION(index, address) ".section h"#index"; .set h"#index","#address";"

asm(
// nop AssignNewTable call
SECTION(0, 0x008BD9BF)
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"mov byte ptr [esp+0xD0-0xC], 2;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
// nop PushStack
SECTION(1, 0x008BDBA6)
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
"nop;"
// return 0 value on stack
SECTION(2, 0x008BDC18)
"mov eax, 0;"
);

0 comments on commit f6abd5e

Please sign in to comment.