1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 09:07:19 +02:00

VehicleObject::canBeRemoved cleanup

This commit is contained in:
Daniel Evans 2019-04-29 20:56:09 +01:00
parent 7af0e8d7cb
commit 5bb67eccb4

View File

@ -644,18 +644,9 @@ float VehicleObject::getVelocity() const {
}
bool VehicleObject::canBeRemoved() const {
if (!GameObject::canBeRemoved()) {
return false;
}
for (auto& seat : seatOccupants) {
auto character = static_cast<CharacterObject*>(seat.second);
if (!character->canBeRemoved())
return false;
}
return true;
return GameObject::canBeRemoved() &&
all_of(seatOccupants.begin(), seatOccupants.end(),
[](const auto& p) { return p.second->canBeRemoved(); });
}
bool VehicleObject::isWrecked() const {