mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 14:00:22 +00:00
dirty fix unicycle counting as car
This commit is contained in:
1 parent
bef623a281
commit
9de5a08b0c
1 file changed
+8
@@ -120,7 +120,15 @@ void TClient::SetCarData(int Ident, const std::string& Data) {
|
|||||||
DeleteCar(Ident);
|
DeleteCar(Ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: count unicycles and vehicles different #246 sla-ppy
|
||||||
|
// PROPOSAL: separate unicycles completely from vehicles???
|
||||||
int TClient::GetCarCount() const {
|
int TClient::GetCarCount() const {
|
||||||
|
std::unique_lock lock(mVehicleDataMutex);
|
||||||
|
for (auto& v : mVehicleData) {
|
||||||
|
if (v.ID() == mUnicycleID) {
|
||||||
|
return int(mVehicleData.size() - 1); // dont keep track of unicycles
|
||||||
|
}
|
||||||
|
}
|
||||||
return int(mVehicleData.size());
|
return int(mVehicleData.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user