| 1012 | } |
| 1013 | |
| 1014 | void 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 | |
| 1042 | void Building::decreasePendingInvestigatorCount(GameState &state) |
| 1043 | { |