Skip to content

Commit

Permalink
Keep decimals of economy values returned by GetRolloverInfo (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
4z0t committed Apr 9, 2024
1 parent 189eed5 commit acaa28b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -39,6 +39,8 @@ These don't matter except for other assembly patches
- hooks/aiinitattack.cpp

## Bugs
- Fix `RolloverInfo` returning integer economy values.
- hooks/GetRolloverInfoFix.cpp
- Fix [problem described here](https://www.lua.org/bugs.html#5.0.2-5)
- hooks/weakgcmarkerFix.cpp
- Fix CUIWorldMesh:GetInterpolatedAlignedBox return table to properly store `ymax` and `zMax`
Expand Down
38 changes: 38 additions & 0 deletions hooks/GetRolloverInfoFix.cpp
@@ -0,0 +1,38 @@
asm(
"LuaObject_SetNumber = 0x908320;"
// energy consumed
".section h0; .set h0,0x8422FD;"
"movd eax, xmm0;"
".section h1; .set h1,0x84230D;"
"call LuaObject_SetNumber;"

// mass consumed
".section h2; .set h2,0x842330;"
"movd eax, xmm0;"
".section h3; .set h3,0x842340;"
"call LuaObject_SetNumber;"

// energy requested
".section h4; .set h4,0x842363;"
"movd eax, xmm0;"
".section h5; .set h5,0x842373;"
"call LuaObject_SetNumber;"

// mass requested
".section h6; .set h6,0x842396;"
"movd eax, xmm0;"
".section h7; .set h7,0x8423A6;"
"call LuaObject_SetNumber;"

// energy produced
".section h8; .set h8,0x8423C9;"
"movd eax, xmm0;"
".section h9; .set h9,0x8423D9;"
"call LuaObject_SetNumber;"

// mass produced
".section h10; .set h10,0x842400;"
"movd eax, xmm0;"
".section h11; .set h11,0x84240C;"
"call LuaObject_SetNumber;"
);

0 comments on commit acaa28b

Please sign in to comment.