Skip to content
Open
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
3 changes: 1 addition & 2 deletions src/Ext/Building/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/Ext/Building/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 3 additions & 4 deletions src/Ext/Unit/Hooks.Harvester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 4 additions & 2 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down