Fixed broken object descriptions for Chinese version

Minor code edits.
This commit is contained in:
NovaRain
2021-12-16 12:38:14 +08:00
parent 5a18570bd9
commit 095dfae544
5 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ VAR_(btncnt, DWORD)
VARD(cap, fo::AIcap) // dynamic array
VAR_(carCurrentArea, DWORD)
VAR_(carGasAmount, long) // from 0 to 80000
VAR_(cmap, DWORD)
VARA(cmap, fo::PALETTE, 256)
VAR_(colorTable, DWORD)
VAR_(combat_end_due_to_load, DWORD)
VAR_(combat_free_move, DWORD)
+1 -1
View File
@@ -173,7 +173,7 @@ static void __declspec(naked) sf_inven_display_msg() {
void Text::init() {
// Support for the newline control character '\n' in the object description in pro_*.msg files
void* printFunc = sf_display_print; // for vanilla and HRP 4.1.8
if (sf::hrpIsEnabled && !sf::hrpVersionValid) {
if (sf::versionCHI || (sf::hrpIsEnabled && !sf::hrpVersionValid)) {
printFunc = sf_display_print_alt;
}
sf::SafeWriteBatch<DWORD>((DWORD)printFunc, {0x46ED87, 0x49AD7A}); // setup_inventory_, obj_examine_
+1 -3
View File
@@ -372,9 +372,7 @@ static void DrawFPS() {}
#endif
static void Present() {
if ((moveWindowKey[0] != 0 && KeyDown(moveWindowKey[0])) ||
(moveWindowKey[1] != 0 && KeyDown(moveWindowKey[1])))
{
if (moveWindowKey[0] != 0 && (KeyDown(moveWindowKey[0]) || (moveWindowKey[1] != 0 && KeyDown(moveWindowKey[1])))) {
int mx, my;
GetMouse(&mx, &my);
windowLeft += mx;
+4
View File
@@ -93,6 +93,8 @@ namespace sfall
bool isDebug = false;
bool versionCHI = false;
bool hrpIsEnabled = false;
bool hrpVersionValid = false; // HRP 4.1.8 version validation
@@ -273,6 +275,8 @@ defaultIni:
IniReader::SetDefaultConfigFile();
}
versionCHI = (*(DWORD*)0x4CAF23 == 0x225559); // check if the exe is modified for Chinese support
hrpIsEnabled = (*(DWORD*)0x4E4480 != 0x278805C7); // check if HRP is enabled
if (hrpIsEnabled) {
GetHRPModule();
+2
View File
@@ -82,6 +82,8 @@ namespace sfall
#define pushadc __asm push eax __asm push edx __asm push ecx
#define popadc __asm pop ecx __asm pop edx __asm pop eax
extern bool versionCHI;
extern bool hrpIsEnabled;
extern bool hrpVersionValid;