From 7cc25efb01784bcf2d8040c7079e24e84ad18529 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 20 Feb 2022 08:56:43 +0800 Subject: [PATCH] Code edits converge with 4.x --- artifacts/ddraw.ini | 2 +- sfall/FalloutEngine/EngineUtils.cpp | 4 ++++ sfall/FalloutEngine/EngineUtils.h | 2 ++ sfall/FalloutEngine/VarPointers_def.h | 2 +- sfall/Modules/Worldmap.cpp | 12 ++++++------ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 423d50c3..b38995da 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -322,7 +322,7 @@ Movie17=credits.mve ;To change the limit of the distance away from the player to which you're allowed to scroll the local maps, uncomment the next two lines ;Defaults are 480 in the x direction and 400 in the y direction. -;Not compatible with the hi-res patch! +;Does not work with the hi-res patch by Mash! ;LocalMapXLimit=480 ;LocalMapYLimit=400 diff --git a/sfall/FalloutEngine/EngineUtils.cpp b/sfall/FalloutEngine/EngineUtils.cpp index 25abec64..3282daf4 100644 --- a/sfall/FalloutEngine/EngineUtils.cpp +++ b/sfall/FalloutEngine/EngineUtils.cpp @@ -77,6 +77,10 @@ char* GetMsg(fo::MessageList* msgList, int msgNum, int msgType) { return nullptr; } +fo::Window* GetWindow(long winID) { + return fo::ptr::window[fo::ptr::window_index[winID]]; +} + fo::Queue* QueueFind(fo::GameObject* object, long type) { if (*fo::ptr::queue) { fo::Queue* queue = *fo::ptr::queue; diff --git a/sfall/FalloutEngine/EngineUtils.h b/sfall/FalloutEngine/EngineUtils.h index cbce0190..6bf382c4 100644 --- a/sfall/FalloutEngine/EngineUtils.h +++ b/sfall/FalloutEngine/EngineUtils.h @@ -50,6 +50,8 @@ fo::MessageNode* GetMsgNode(fo::MessageList* msgList, int msgNum); char* GetMsg(fo::MessageList* msgList, int msgNum, int msgType); +fo::Window* GetWindow(long winID); + fo::Queue* QueueFind(fo::GameObject* object, long type); // returns weapon animation code diff --git a/sfall/FalloutEngine/VarPointers_def.h b/sfall/FalloutEngine/VarPointers_def.h index 1954df0b..91c86709 100644 --- a/sfall/FalloutEngine/VarPointers_def.h +++ b/sfall/FalloutEngine/VarPointers_def.h @@ -17,7 +17,7 @@ PTR_(btncnt, DWORD) PTR_(cap, fo::AIcap*) // dynamic array PTR_(carCurrentArea, DWORD) PTR_(carGasAmount, long) // from 0 to 80000 -PTR_(cmap, fo::PALETTE) // array of 256 PALETTE +PTR_(cmap, fo::PALETTE) // array of 256 PALETTE, palette without gamma PTR_(colorTable, DWORD) PTR_(combat_free_move, DWORD) PTR_(combat_list, fo::GameObject**) // dynamic array diff --git a/sfall/Modules/Worldmap.cpp b/sfall/Modules/Worldmap.cpp index 3fe6abd9..86bdf787 100644 --- a/sfall/Modules/Worldmap.cpp +++ b/sfall/Modules/Worldmap.cpp @@ -324,15 +324,15 @@ end: } } -static void WorldLimitsPatches() { - DWORD data = IniReader::GetConfigInt("Misc", "LocalMapXLimit", 0); - if (data) { +static void MapLimitsPatches() { + long data = IniReader::GetConfigInt("Misc", "LocalMapXLimit", 0); + if (data > 0) { dlog("Applying local map x limit patch.", DL_INIT); SafeWrite32(0x4B13B9, data); dlogr(" Done", DL_INIT); } data = IniReader::GetConfigInt("Misc", "LocalMapYLimit", 0); - if (data) { + if (data > 0) { dlog("Applying local map y limit patch.", DL_INIT); SafeWrite32(0x4B13C7, data); dlogr(" Done", DL_INIT); @@ -341,7 +341,7 @@ static void WorldLimitsPatches() { //if (IniReader::GetConfigInt("Misc", "CitiesLimitFix", 0)) { dlog("Applying cities limit patch.", DL_INIT); if (*((BYTE*)0x4BF3BB) != CodeType::JumpShort) { - SafeWrite8(0x4BF3BB, CodeType::JumpShort); + SafeWrite8(0x4BF3BB, CodeType::JumpShort); // wmAreaInit_ } dlogr(" Done", DL_INIT); //} @@ -564,7 +564,7 @@ void Worldmap::init() { PathfinderFixInit(); StartingStatePatches(); TimeLimitPatch(); - WorldLimitsPatches(); + MapLimitsPatches(); WorldmapFpsPatch(); PipBoyAutomapsPatch();