Skip to content

Commit

Permalink
Adjust LimboDelivery discovery checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Starkku committed Jun 3, 2023
1 parent 3eb84f9 commit a32076e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Ext/SWType/FireSuperWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ inline void LimboCreate(BuildingTypeClass* pType, HouseClass* pOwner, int ID)
pBuilding->IsAlive = true;
pBuilding->IsOnMap = true;

// For reasons beyond my comprehension, the discovery logic is checked for certain logics like power drain/output in singleplayer only.
// This code replicates how DiscoveredBy() is called in BuildingClass::Unlimbo() - Starkku
if (!pBuilding->DiscoveredByCurrentPlayer && (pBuilding->GetCell()->AltFlags & AltCellFlags::NoFog) != AltCellFlags(0) || SessionClass::Instance->GameMode == GameMode::Campaign)
// For reasons beyond my comprehension, the discovery logic is checked for certain logics like power drain/output in campaign only.
// Normally on unlimbo the buildings are revealed to current player if unshrouded or if game is a campaign and to non-player houses always.
// Because of the unique nature of LimboDelivered buildings, this has been adjusted to always reveal to the current player in singleplayer
// and to the owner of the building regardless, removing the shroud check from the equation since they don't physically exist - Starkku
if (SessionClass::Instance->GameMode == GameMode::Campaign)
pBuilding->DiscoveredBy(HouseClass::CurrentPlayer);

if (!pOwner->IsControlledByHuman())
pBuilding->DiscoveredBy(pOwner);
pBuilding->DiscoveredBy(pOwner);

pOwner->RegisterGain(pBuilding, false);
pOwner->UpdatePower();
Expand Down

0 comments on commit a32076e

Please sign in to comment.