| 230 | } |
| 231 | |
| 232 | bool 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 | |
| 259 | size_t HouseExt::FindBuildableIndex( |
| 260 | HouseClass const* const pHouse, int const idxParentCountry, |
nothing calls this directly
no outgoing calls
no test coverage detected