MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setFuel

Method setFuel

src/Savegame/Craft.cpp:501–512  ·  view source on GitHub ↗

* Changes the amount of fuel currently contained * in this craft. * @param fuel Amount of fuel. */

Source from the content-addressed store, hash-verified

499 * @param fuel Amount of fuel.
500 */
501void Craft::setFuel(int fuel)
502{
503 _fuel = fuel;
504 if (_fuel > _rules->getMaxFuel())
505 {
506 _fuel = _rules->getMaxFuel();
507 }
508 else if (_fuel < 0)
509 {
510 _fuel = 0;
511 }
512}
513
514/**
515 * Returns the ratio between the amount of fuel currently

Callers

nothing calls this directly

Calls 1

getMaxFuelMethod · 0.80

Tested by

no test coverage detected