MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / IsDisabledFromShell

Method IsDisabledFromShell

src/Ext/House/Body.cpp:232–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232bool HouseExt::IsDisabledFromShell(
233 HouseClass const* const pHouse, BuildingTypeClass const* const pItem)
234{
235 // SWAllowed does not apply to campaigns any more
236 if (SessionClass::IsCampaign()
237 || GameModeOptionsClass::Instance.SWAllowed)
238 {
239 return false;
240 }
241
242 if (pItem->SuperWeapon != -1)
243 {
244 // allow SWs only if not disableable from shell
245 auto const pItem2 = const_cast<BuildingTypeClass*>(pItem);
246 auto const& BuildTech = RulesClass::Instance->BuildTech;
247
248 if (BuildTech.FindItemIndex(pItem2) == -1)
249 {
250 auto const pSuper = pHouse->Supers[pItem->SuperWeapon];
251 if (pSuper->Type->DisableableFromShell)
252 return true;
253 }
254 }
255
256 return false;
257}
258
259size_t HouseExt::FindBuildableIndex(
260 HouseClass const* const pHouse, int const idxParentCountry,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected