diff --git a/CREDITS.md b/CREDITS.md index c6d512c213..f18ff7c92c 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -350,6 +350,7 @@ This page lists all the individual contributions to the project by their author. - Tunnel/Walk/Mech locomotor being stuck when moving too fast bugfix - Assign Super Weapon cameo to any sidebar tab - Fix impassable invisible barrier created by chronosphere on uncrushable unit. + - Fix amphibious harvesters can not automatically return to refineries with `WaterBound` - Exclusive SuperWeapon Sidebar - **Apollo** - Translucent SHP drawing patches - **ststl** diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index e43e416d5f..bb2c2bf1a1 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -194,6 +194,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Fix the bug that parasite will vanish if it missed its target when its previous cell is occupied. - Prevent the units with locomotors that cause problems from entering the tank bunker. - Fix an issue where a unit will leave an impassable invisible barrier in its original position when it is teleported by ChronoSphere onto an uncrushable unit and self destruct. +- Fix an issue that harvesters with amphibious movement zone can not automatically return to refineries with `WaterBound` on water surface. ## Fixes / interactions with other extensions diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 0a558bf148..1810e8d887 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -357,6 +357,7 @@ Vanilla fixes: - Fix the bug that parasite will vanish if it missed its target when its previous cell is occupied (by 航味麻酱) - Prevent the units with locomotors that cause problems from entering the tank bunker (by TaranDahl) - Fix an issue where a unit will leave an impassable invisible barrier in its original position when it is teleported by ChronoSphere onto an uncrushable unit and self destruct (by NetsuNegi) +- Fix an issue that harvesters with amphibious movement zone can not automatically return to refineries with `WaterBound` on water surface (by NetsuNegi) - Units are now unable to kick out from a factory that is in construction process, and will not always stuck in the factory (by CrimRecya & TaranDahl) - Observer sidebar in skirmish game mode (by CrimRecya) diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index a9732a8f77..9e00876c63 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -1104,6 +1104,25 @@ DEFINE_HOOK(0x71872C, TeleportLocomotionClass_MakeRoom_OccupationFix, 0x9) #pragma endregion +#pragma region AmphibiousHarvester + +DEFINE_HOOK(0x73ED66, UnitClass_Mission_Harvest_PathfindingFix, 0x5) +{ + GET(UnitClass*, pThis, EBP); + REF_STACK(SpeedType, speedType, STACK_OFFSET(0xA0, -0x98)); + REF_STACK(int, currentZoneType, STACK_OFFSET(0xA0, -0x94)); + REF_STACK(MovementZone, movementZone, STACK_OFFSET(0xA0, -0x90)); + + const auto pType = pThis->Type; + speedType = pType->SpeedType; + movementZone = pType->MovementZone; + currentZoneType = MapClass::Instance->GetMovementZoneType(pThis->GetMapCoords(), movementZone, pThis->OnBridge); + + return 0; +} + +#pragma endregion + #pragma region StopEventFix DEFINE_HOOK(0x4C75DA, EventClass_RespondToEvent_Stop, 0x6)