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

Method getDamagePercentage

src/Savegame/Craft.cpp:552–555  ·  view source on GitHub ↗

* Returns the ratio between the amount of damage this * craft can take and the total it can take before it's * destroyed. * @return Percentage of damage. */

Source from the content-addressed store, hash-verified

550 * @return Percentage of damage.
551 */
552int Craft::getDamagePercentage() const
553{
554 return (int)floor((double)_damage / _rules->getMaxDamage() * 100);
555}
556
557/**
558 * Returns whether the craft is currently low on fuel

Callers 4

initMethod · 0.80
GeoscapeCraftStateMethod · 0.80
drawCraftDamageMethod · 0.80
moveMethod · 0.80

Calls 1

getMaxDamageMethod · 0.45

Tested by

no test coverage detected