-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vehicle destroy and damage levels, hax siren and headlights #265
Conversation
@@ -28,6 +28,13 @@ const modelToName = require("../../../data/2015/sampleData/ModelToName.json"); | |||
const _ = require("lodash"); | |||
const debug = require("debug")("zonepacketHandlers"); | |||
|
|||
let vehicleState = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why creating them that up in the file ? Like that these values will almost never get cleared from memory, you should define them right before the switch case where they are used
delete client.mountedVehicle; | ||
vehicleState = 0; | ||
client.isPolice = false; | ||
} else if (vehicleState === 500) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use a switch for this
Its for singleplayer only, so i based the "health" on adding value to a variable and didnt bother about seperate health for multiple vehicles. If we apply siren or headlights then we cant turn them off, for that we need a proper effect packet, as well as for it to work in multiplayer.
I based my work on master branch cause i had problems with /hax drive on dev