Move local player vehicle control state to vehicle.js
This commit is contained in:
@@ -171,4 +171,27 @@ function removeVehiclesFromClient() {
|
||||
getServerData().vehicles.splice(0);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function processLocalPlayerVehicleControlState() {
|
||||
if (areServerElementsSupported()) {
|
||||
if (localPlayer.vehicle != null) {
|
||||
if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) {
|
||||
if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) {
|
||||
setImmediate(function () {
|
||||
localPlayer.vehicle.engine = getEntityData(localPlayer.vehicle, "v.rp.engine");
|
||||
});
|
||||
|
||||
if (!getEntityData(localPlayer.vehicle, "v.rp.engine")) {
|
||||
if (typeof localPlayer.vehicle.velocity != "undefined") {
|
||||
localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0);
|
||||
localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user