diff --git a/YRpp b/YRpp index 4ce57fba70..9946953417 160000 --- a/YRpp +++ b/YRpp @@ -1 +1 @@ -Subproject commit 4ce57fba70936c8fbda1d7eeafc53298174615a2 +Subproject commit 9946953417d8a6de27b88836a5b16086cd96a348 diff --git a/src/Ext/Building/Body.cpp b/src/Ext/Building/Body.cpp index ffa3f1c6e0..f1c0f86fc8 100644 --- a/src/Ext/Building/Body.cpp +++ b/src/Ext/Building/Body.cpp @@ -364,8 +364,7 @@ void BuildingExt::KickOutStuckUnits(BuildingClass* pThis) } } - auto buffer = CoordStruct::Empty; - auto pCell = MapClass::Instance.GetCellAt(*pThis->GetExitCoords(&buffer, 0)); + auto pCell = MapClass::Instance.GetCellAt(pThis->GetExitCoords(0)); int i = 0; while (true) diff --git a/src/Ext/Building/Hooks.cpp b/src/Ext/Building/Hooks.cpp index c4c947e969..340a823d18 100644 --- a/src/Ext/Building/Hooks.cpp +++ b/src/Ext/Building/Hooks.cpp @@ -174,8 +174,7 @@ DEFINE_HOOK(0x44CEEC, BuildingClass_Mission_Missile_EMPulseSelectWeapon, 0x6) CoordStruct* __fastcall BuildingClass_GetFireCoords_Wrapper(BuildingClass* pThis, void* _, CoordStruct* pCrd, int weaponIndex) { - auto coords = MapClass::Instance.GetCellAt(pThis->Owner->EMPTarget)->GetCellCoords(); - pCrd = pThis->GetFLH(&coords, EMPulseCannonTemp::weaponIndex, *pCrd); + *pCrd = pThis->GetFLH(EMPulseCannonTemp::weaponIndex); return pCrd; } diff --git a/src/Ext/Unit/Hooks.Harvester.cpp b/src/Ext/Unit/Hooks.Harvester.cpp index d700e4b309..4b8c5a9176 100644 --- a/src/Ext/Unit/Hooks.Harvester.cpp +++ b/src/Ext/Unit/Hooks.Harvester.cpp @@ -43,12 +43,11 @@ DEFINE_HOOK(0x73E730, UnitClass_MissionHarvest_HarvesterScanAfterUnload, 0x5) // Focus is set when the harvester is fully loaded and go home. if (pFocus && !pType->Weeder && TechnoTypeExt::ExtMap.Find(pType)->HarvesterScanAfterUnload.Get(RulesExt::Global()->HarvesterScanAfterUnload)) { - auto cellBuffer = CellStruct::Empty; - const auto pCellStru = pThis->ScanForTiberium(&cellBuffer, RulesClass::Instance->TiberiumLongScan / Unsorted::LeptonsPerCell, 0); + const auto pCellStru = pThis->ScanForTiberium(RulesClass::Instance->TiberiumLongScan / Unsorted::LeptonsPerCell, 0); - if (*pCellStru != CellStruct::Empty) + if (pCellStru != CellStruct::Empty) { - const auto pCell = MapClass::Instance.TryGetCellAt(*pCellStru); + const auto pCell = MapClass::Instance.TryGetCellAt(pCellStru); const auto distFromTiberium = pCell ? pThis->DistanceFrom(pCell) : -1; const auto distFromFocus = pThis->DistanceFrom(pFocus); diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index 71910fc896..8df88c0027 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -1528,7 +1528,8 @@ DEFINE_HOOK(0x446BF4, BuildingClass_Place_FreeUnit_NearByLocation, 0x6) const auto movementZone = pFreeUnit->Type->MovementZone; const auto currentZone = MapClass::Instance.GetMovementZoneType(mapCoords, movementZone, false); - R->EAX(MapClass::Instance.NearByLocation(*outBuffer, mapCoords, pFreeUnit->Type->SpeedType, currentZone, movementZone, false, 1, 1, true, true, false, false, CellStruct::Empty, false, false)); + *outBuffer = MapClass::Instance.NearByLocation(mapCoords, pFreeUnit->Type->SpeedType, currentZone, movementZone, false, 1, 1, true, true, false, false, CellStruct::Empty, false, false); + R->EAX(outBuffer); return SkipGameCode; } @@ -1543,7 +1544,8 @@ DEFINE_HOOK(0x446D42, BuildingClass_Place_FreeUnit_NearByLocation2, 0x6) const auto movementZone = pFreeUnit->Type->MovementZone; const auto currentZone = MapClass::Instance.GetMovementZoneType(mapCoords, movementZone, false); - R->EAX(MapClass::Instance.NearByLocation(*outBuffer, mapCoords, pFreeUnit->Type->SpeedType, currentZone, movementZone, false, 1, 1, false, true, false, false, CellStruct::Empty, false, false)); + *outBuffer = MapClass::Instance.NearByLocation(mapCoords, pFreeUnit->Type->SpeedType, currentZone, movementZone, false, 1, 1, false, true, false, false, CellStruct::Empty, false, false); + R->EAX(outBuffer); return SkipGameCode; }