Skip to content

Commit

Permalink
Fix flashing fuel indicator & up some chances
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed May 26, 2018
1 parent 519c5a0 commit c3e8ad8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CorruptSnail/CVehicle/VehFuelHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public VehFuelHandler()

private async Task OnTick()
{
await Delay(100);

Ped playerPed; Vehicle veh;
if ((playerPed = LocalPlayer.Character) != null && (veh = playerPed.CurrentVehicle) != null)
{
Expand All @@ -34,7 +32,7 @@ private async Task OnTick()
{
if (veh.GetPedOnSeat(VehicleSeat.Driver) == playerPed && !veh.IsInAir)
{
float newFuelLevel = EntityDecoration.Get<float>(veh, VEH_FUEL_DECOR) - veh.Speed * 0.1f;
float newFuelLevel = EntityDecoration.Get<float>(veh, VEH_FUEL_DECOR) - veh.Speed * 0.01f;
if (newFuelLevel < 0f)
newFuelLevel = 0f;
EntityDecoration.Set(veh, VEH_FUEL_DECOR, newFuelLevel);
Expand All @@ -48,6 +46,8 @@ private async Task OnTick()
Screen.DisplayHelpTextThisFrame("Low Fuel Level");
}
}

await Task.FromResult(0);
}
}
}
2 changes: 1 addition & 1 deletion CorruptSnail/Spawners/SpawnerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SpawnerHost : BaseScript
{
public const float SPAWN_MIN_DISTANCE = 100f;
public const float SPAWN_DESPAWN_DISTANCE = 350f;
public const double SPAWN_EVENT_CHANCE = 0.0005;
public const double SPAWN_EVENT_CHANCE = 0.005;
public const int SPAWN_TICK_RATE = 100;
private const float SPAWN_HOST_DECIDE_DISTANCE = 500f;

Expand Down
1 change: 0 additions & 1 deletion menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function spawnVehicleToPlayer(model)
end

local veh = CreateVehicle(model, x + 2.5, y + 2.5, z + 1, 0.0, true, true)
SetVehicleAsNoLongerNeeded(veh)
drawNotification("~g~Vehicle spawned!")
end

Expand Down

0 comments on commit c3e8ad8

Please sign in to comment.