Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ This page lists all the individual contributions to the project by their author.
- Fix the issue that the Jumpjet must end its movement before starting the next mission
- Taunt warhead
- Fix the bug where non-Teleporter miners would not return to work after minerals are depleted and then regenerated
- Miners back to work when ore regenerated
- **solar-III (凤九歌)**
- Target scanning delay customization (documentation)
- Skip target scanning function calling for unarmed technos (documentation)
Expand Down
2 changes: 1 addition & 1 deletion YRpp
Submodule YRpp updated 3 files
+67 −0 AStarClass.h
+4 −0 FootClass.h
+1 −0 GameClasses.h
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7) that was triggered when repairing because the `Strength` value was lower than `RepairStep`.
- Fixed the bug where non-Teleporter miners would not return to work after minerals are depleted and then regenerated.
- Fixed a desync due to an inconsistent shroud state caused by `GapGenerator` and `SpySat` interaction.
- Now miners will no longer withdraw from the Harvest mission due to mineral depletion and will periodically attempt to return to work.

## Fixes / interactions with other extensions

Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ Vanilla fixes:
- Fixed an issue where a unit might cause the target to fall from above its own head when using a locomotor warhead with `Locomotor=Jumpjet` to pull a target with `BalloonHover=yes` (by NetsuNegi)
- Fixed the [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7) caused when the `Strength` value is lower than `RepairStep` (by NetsuNegi)
- Fixed the bug where non-Teleporter miners would not return to work after minerals are depleted and then regenerated (by TaranDahl)
- Miners back to work when ore regenerated (by TaranDahl)

Phobos fixes:
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)
Expand Down
27 changes: 26 additions & 1 deletion src/Ext/Unit/Hooks.Harvester.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Ext/Techno/Body.h>
#include <Ext/Techno/Body.h>

#pragma region EnterRefineryFix

Expand Down Expand Up @@ -240,3 +240,28 @@ DEFINE_HOOK(0x738A3E, UnitClass_EnterIdleMode_SubterraneanHarvester, 0x5)
// Skip the check for Teleporter here; this is an unreasonable check.
// This check determines whether miners on a Guard mission near the refinery should return to the Harvest mission.
DEFINE_JUMP(LJMP, 0x740943, 0x740957);

// Now, miners will no longer actively withdraw from the Harvest mission due to mineral depletion.
DEFINE_HOOK(0x73EEA6, UnitClass_MissionHarvest_AllOreGathered, 0x6)
{
enum { SkipGameCode = 0x73EFA4 };

GET(UnitClass*, pThis, EBP);

auto pBuilding = MapClass::Instance.GetCellAt(pThis->GetCoords())->GetBuilding();
if (pBuilding && (pBuilding->Type->Refinery || pBuilding->Type->Weeder))
{
CellStruct buffer = CellStruct::Empty;
pThis->NearbyLocation(&buffer, pBuilding);
auto pDest = MapClass::Instance.GetCellAt(buffer);
pThis->SetDestination(pDest, false);
R->EAX(15);
}
else
{
pThis->MissionStatus = 0;
R->EAX(100);
}

return SkipGameCode;
}
Loading