Skip to content

Commit

Permalink
GetEconDataAsFloat (#14)
Browse files Browse the repository at this point in the history
Use floats instead of integers in UserUnit:GetEconData() for better accuracy
  • Loading branch information
Strogoo authored Feb 25, 2023
1 parent acc6893 commit f5bcbe7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions hooks/GetEconDataAsFloats.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
asm(
//energyConsumedAsFloat
".section h0; .set h0,0x8C52A5;"
"movd ecx, xmm0;"
".section h1; .set h1,0x8C52B7;"
"call 0x908320;"

//massConsumedAsFloat
".section h2; .set h2,0x8C52DA;"
"movd ecx, xmm0;"
".section h3; .set h3,0x8C52EC;"
"call 0x908320;"

// energyRequestedAsFloat
".section h4; .set h4,0x8C530F;"
"movd ecx, xmm0;"
".section h5; .set h5,0x8C5321;"
"call 0x908320;"

// massRequestedAsFloat
".section h6; .set h6,0x8C5344;"
"movd ecx, xmm0;"
".section h7; .set h7,0x8C5356;"
"call 0x908320;"

// energyProducedAsFloat
".section h8; .set h8,0x8C5379;"
"movd ecx, xmm0;"
".section h9; .set h9,0x8C538B;"
"call 0x908320;"

// massProducedAsFloat
".section h10; .set h10,0x8C53B2;"
"movd ecx, xmm0;"
".section h11; .set h11,0x8C53C0;"
"call 0x908320;"
);

0 comments on commit f5bcbe7

Please sign in to comment.