Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
Fix truck state saving and add reverse engine lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ikt32 committed Feb 28, 2016
1 parent 0a42683 commit a0604fa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Gears/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ void update() {
vehData.ReadMemData(ext, vehicle);
vehData.LockGear = (0xFFFF0000 & vehData.LockGears) >> 16;
simpleBike = vehData.IsBike && settings.SimpleBike;
vehData.LockTruck = vehData.IsTruck;

if (lastKeyboard()) {
controls.Rtvalf = (controls.IsKeyPressed(controls.Control[ScriptControls::KThrottle]) ? 1.0f : 0.0f);
Expand Down Expand Up @@ -450,16 +449,25 @@ void functionEngBrake() {
float brakeForce = -0.1f * (1.0f - controls.Clutchvalf) * vehData.Rpm;
ENTITY::APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(vehicle, 1, 0.0f, brakeForce, 0.0f, true, true, true, true);
}

// Reverse Gear
if (vehData.CurrGear == 0 && vehData.Velocity > 0.0f && vehData.Clutch > 0.4f) {
VEHICLE::SET_VEHICLE_HANDBRAKE(vehicle, true);
}
else {
VEHICLE::SET_VEHICLE_HANDBRAKE(vehicle, false);
}
}

void functionRevBehavior() {

}

void functionTruckLimiting() {
// Save speed
// Update speed
if (vehData.CurrGear < vehData.NextGear) {
vehData.LockSpeed = vehData.Velocity;
vehData.LockTruck = true;
}

// Limit
Expand Down

0 comments on commit a0604fa

Please sign in to comment.