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:
parent
7af0e8d7cb
commit
5bb67eccb4
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user