Skip to content

Commit

Permalink
UpgradeProgressFix
Browse files Browse the repository at this point in the history
  • Loading branch information
KionX committed Jan 5, 2023
1 parent 20f64d6 commit 55ddea2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ This are just the patch files for this game. I decided to separate them from pat

# Change List
## Fixes
- Upgrade Progress Fix
- hooks/HUpgradeProgressFix.cpp
- section/UpgradeProgressFix.cpp
- Allows to use 4GB on x64
- hooks/HFix4GB.cpp
- Reduce call sim beat of UI
Expand Down
5 changes: 5 additions & 0 deletions hooks/HUpgradeProgressFix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "../define.h"
asm(
".section h0; .set h0,0x5F5C21;"
"JMP "QU(UpgradeProgressFix)";"
);
12 changes: 12 additions & 0 deletions section/UpgradeProgressFix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
void UpgradeProgressFix() {
asm(
"MOV EAX,[EBP+8];"
"MOV EAX,[EAX-4+0xE0];"
"MOV [EBP+0x3C],EAX;"
"MOV EDX,[EBP];"
"MOV [EDX+0x2AC],EAX;"
"MOV EAX,DWORD PTR DS:[ECX];"
"MOV EDX,DWORD PTR DS:[EAX+0x3C];"
"JMP 0x5F5C26;"
);
}
8 changes: 8 additions & 0 deletions section/include/moho.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,12 @@ struct Unit : WeakObject
// at 0x294
float FuelRatio;
float ShieldRatio; // Readonly
// at 0x2A0
bool Paused;
// at 0x2AC
float WorkProgress;
// at 0x2CC
string customUnitName;
// at 0x380
UserUnitWeapon* Weapons;
list<unk_t> unk22; // Weapons?
Expand Down Expand Up @@ -830,6 +834,10 @@ struct UserUnit : UserEntity
// at 0x44
int UnitID;
RUnitBlueprint *blueprint;
// at 0x1B0
bool Paused;
// at 0x1BC
float WorkProgress;
// at 0x1DC
string customUnitName;
// at 0x290
Expand Down

0 comments on commit 55ddea2

Please sign in to comment.