Skip to content
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

Merged
merged 8 commits into from
Jun 23, 2021

Conversation

avcio9
Copy link
Collaborator

@avcio9 avcio9 commented Jun 23, 2021

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

@avcio9 avcio9 marked this pull request as draft June 23, 2021 19:39
@avcio9 avcio9 marked this pull request as ready for review June 23, 2021 19:55
@@ -28,6 +28,13 @@ const modelToName = require("../../../data/2015/sampleData/ModelToName.json");
const _ = require("lodash");
const debug = require("debug")("zonepacketHandlers");

let vehicleState = 0;
Copy link
Owner

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) {
Copy link
Owner

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

src/servers/ZoneServer/zonepackethandlers.ts Outdated Show resolved Hide resolved
src/servers/ZoneServer/commands/hax.ts Outdated Show resolved Hide resolved
@QuentinGruber QuentinGruber merged commit d95b2b8 into QuentinGruber:dev Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants