mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed jerry can madness (#8348)
Fixed refueling vehicles with high input rates when using fuel sources with low fuel capacity.
This commit is contained in:
parent
128ddf2591
commit
1c921674a9
@ -74,13 +74,19 @@ if (_maxFuel == 0) then {
|
||||
private _rateTime = _rate * (CBA_missionTime - (_nozzle getVariable [QGVAR(lastTickMissionTime), CBA_missionTime]));
|
||||
_nozzle setVariable [QGVAR(lastTickMissionTime), CBA_missionTime];
|
||||
|
||||
if !(_fuelInSource == REFUEL_INFINITE_FUEL) then {
|
||||
_fuelInSource = _fuelInSource - _rateTime;
|
||||
if (_fuelInSource != REFUEL_INFINITE_FUEL) then {
|
||||
if (_rateTime > _fuelInSource) then {
|
||||
_rateTime = _fuelInSource;
|
||||
_fuelInSource = 0;
|
||||
} else {
|
||||
_fuelInSource = _fuelInSource - _rateTime;
|
||||
};
|
||||
} else {
|
||||
_source setVariable [QGVAR(fuelCounter), (_source getVariable [QGVAR(fuelCounter), 0]) + _rateTime, true];
|
||||
};
|
||||
if (_fuelInSource < 0 && {_fuelInSource > REFUEL_INFINITE_FUEL}) then {
|
||||
if (_fuelInSource <= 0 && {_fuelInSource != REFUEL_INFINITE_FUEL}) then {
|
||||
_fuelInSource = 0;
|
||||
[_source, _fuelInSource] call FUNC(setFuel);
|
||||
_finished = true;
|
||||
[LSTRING(Hint_SourceEmpty), 2, _unit] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user