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

Method cancel

src/Battlescape/ProjectileFlyBState.cpp:589–598  ·  view source on GitHub ↗

* Flying projectiles cannot be cancelled, * but they can be "skipped". */

Source from the content-addressed store, hash-verified

587 * but they can be "skipped".
588 */
589void ProjectileFlyBState::cancel()
590{
591 if (_parent->getMap()->getProjectile())
592 {
593 _parent->getMap()->getProjectile()->skipTrajectory();
594 Position p = _parent->getMap()->getProjectile()->getPosition();
595 if (!_parent->getMap()->getCamera()->isOnScreen(Position(p.x/16, p.y/16, p.z/24), false))
596 _parent->getMap()->getCamera()->centerOnPosition(Position(p.x/16, p.y/16, p.z/24));
597 }
598}
599
600/**
601 * Validates the throwing range.

Callers

nothing calls this directly

Calls 8

getProjectileMethod · 0.80
skipTrajectoryMethod · 0.80
isOnScreenMethod · 0.80
getCameraMethod · 0.80
centerOnPositionMethod · 0.80
PositionClass · 0.70
getMapMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected