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

Method refuel

src/Savegame/Craft.cpp:728–743  ·  view source on GitHub ↗

* Refuels the craft every 30 minutes * while it's docked in the base. */

Source from the content-addressed store, hash-verified

726 * while it's docked in the base.
727 */
728void Craft::refuel()
729{
730 setFuel(_fuel + _rules->getRefuelRate());
731 if (_fuel >= _rules->getMaxFuel())
732 {
733 _status = "STR_READY";
734 for (std::vector<CraftWeapon*>::iterator i = _weapons.begin(); i != _weapons.end(); ++i)
735 {
736 if (*i && (*i)->isRearming())
737 {
738 _status = "STR_REARMING";
739 break;
740 }
741 }
742 }
743}
744
745/**
746 * Rearms the craft's weapons by adding ammo every hour

Callers 1

time30MinutesMethod · 0.80

Calls 3

getRefuelRateMethod · 0.80
getMaxFuelMethod · 0.80
isRearmingMethod · 0.80

Tested by

no test coverage detected