MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / buildingPartChange

Method buildingPartChange

game/state/city/building.cpp:1014–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014void Building::buildingPartChange(GameState &state, Vec3<int> part, bool intact)
1015{
1016 // FIXME: Implement proper base / building dying when enough is destroyed
1017 // Implement agents dying when building dies
1018 if (intact)
1019 {
1020 buildingParts.insert(part);
1021 }
1022 else
1023 {
1024 buildingParts.erase(part);
1025 if (buildingParts.find(crewQuarters) == buildingParts.end())
1026 {
1027 for (auto agent : currentAgents)
1028 {
1029 agent->die(state, true);
1030 }
1031 }
1032 if (!isAlive())
1033 {
1034 if (base)
1035 {
1036 base->die(state, true);
1037 }
1038 }
1039 }
1040}
1041
1042void Building::decreasePendingInvestigatorCount(GameState &state)
1043{

Callers 3

dieMethod · 0.80
collapseMethod · 0.80
repairMethod · 0.80

Calls 3

insertMethod · 0.80
endMethod · 0.80
dieMethod · 0.45

Tested by

no test coverage detected