Skip to content

Commit

Permalink
Ignore objects in invalid map coords for starting view / AI base cent…
Browse files Browse the repository at this point in the history
…er calculations
  • Loading branch information
Starkku committed May 20, 2024
1 parent 8906cc6 commit fab37f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Skipped drawing rally point line when undeploying a factory.
- Tint effects are now correctly applied to SHP vehicles and all types of aircraft as well as building animations regardless of their position.
- Iron Curtained / Force Shielded objects now always use the correct tint color.

- Objects in invalid map coordinates are no longer used for starting view and AI base center calculations.

## Fixes / interactions with other extensions

- All forms of type conversion (including Ares') now correctly update `OpenTopped` state of passengers in transport that is converted.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ Vanilla fixes:
- Skipped drawing the rally point line when undeploying a factory (by Trsdy)
- Tint effects are now correctly applied to SHP vehicles and all types of aircraft as well as building animations regardless of their position (by Starkku)
- Iron Curtained / Force Shielded objects now always use the correct tint color (by Starkku)
- Objects in invalid map coordinates are no longer used for starting view and AI base center calculations (by Starkku)
Phobos fixes:
- Fixed a few errors of calling for superweapon launch by `LaunchSW` or building infiltration (by Trsdy)
Expand Down
17 changes: 16 additions & 1 deletion src/Ext/House/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,23 @@ DEFINE_HOOK(0x4FD1CD, HouseClass_RecalcCenter_LimboDelivery, 0x6)

auto const pExt = RecalcCenterTemp::pExtData;

if (pExt && pExt->OwnsLimboDeliveredBuilding(pBuilding))
if (!MapClass::Instance->CoordinatesLegal(pBuilding->GetMapCoords())
|| (pExt && pExt->OwnsLimboDeliveredBuilding(pBuilding)))
{
return R->Origin() == 0x4FD1CD ? SkipBuilding1 : SkipBuilding2;
}

return 0;
}

DEFINE_HOOK(0x4AC534, DisplayClass_ComputeStartPosition_IllegalCoords, 0x6)
{
enum { SkipTechno = 0x4AC55B };

GET(TechnoClass* const, pTechno, ECX);

if (!MapClass::Instance->CoordinatesLegal(pTechno->GetMapCoords()))
return SkipTechno;

return 0;
}
Expand Down

0 comments on commit fab37f1

Please sign in to comment.