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

Method detect

src/Savegame/Craft.cpp:694–700  ·  view source on GitHub ↗

* Returns if a certain target is detected by the craft's * radar, taking in account the range and chance. * @param target Pointer to target to compare. * @return True if it's detected, False otherwise. */

Source from the content-addressed store, hash-verified

692 * @return True if it's detected, False otherwise.
693 */
694bool Craft::detect(Target *target) const
695{
696 if (_rules->getRadarRange() == 0)
697 return false;
698 double range = _rules->getRadarRange() * (1 / 60.0) * (M_PI / 180);
699 return (getDistance(target) <= range);
700}
701
702/**
703 * Consumes the craft's fuel every 10 minutes

Callers

nothing calls this directly

Calls 1

getRadarRangeMethod · 0.45

Tested by

no test coverage detected