Pirates fuel problem
Posted: Sat May 31, 2014 2:19 pm
I found out that pirates are stranded because they run out of fuel. So I made
changes to Pirates.lua and added :P
and I got floating point exceptions.
Then fired gdb and found out that program gets exception in
function Ship::GetSpeedReachedWithFuel() because of negative log argument.
Problem i that SetFuel does not calls UpdateFuelStats() and that is problem
on refueling.
So I just mad call inside SetFuel and everything is fine ;)
Made pirates spawn closer relative to ship and make some police
spawn to chase pirates.
Game is fun1!
changes to Pirates.lua and added :P
Code: Select all
local onShipFuelChanged = function (ship, fuelStatus)
-- if ship:IsPlayer() then return end
print(ship.label..' fuel status changed to '..fuelStatus)
ship:SetFuelPercent(100)
end
Then fired gdb and found out that program gets exception in
function Ship::GetSpeedReachedWithFuel() because of negative log argument.
Problem i that SetFuel does not calls UpdateFuelStats() and that is problem
on refueling.
So I just mad call inside SetFuel and everything is fine ;)
Made pirates spawn closer relative to ship and make some police
spawn to chase pirates.
Game is fun1!