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

Method startDogfight

src/Geoscape/GeoscapeState.cpp:2073–2102  ·  view source on GitHub ↗

* Starts a new dogfight. */

Source from the content-addressed store, hash-verified

2071 * Starts a new dogfight.
2072 */
2073void GeoscapeState::startDogfight()
2074{
2075 if (_globe->getZoom() < 3)
2076 {
2077 if (!_zoomInEffectTimer->isRunning())
2078 {
2079 _globe->saveZoomDogfight();
2080 _globe->rotateStop();
2081 _zoomInEffectTimer->start();
2082 }
2083 }
2084 else
2085 {
2086 _dogfightStartTimer->stop();
2087 _zoomInEffectTimer->stop();
2088 timerReset();
2089 while(!_dogfightsToBeStarted.empty())
2090 {
2091 _dogfights.push_back(_dogfightsToBeStarted.back());
2092 _dogfightsToBeStarted.pop_back();
2093 _dogfights.back()->setInterceptionNumber(getFirstFreeDogfightSlot());
2094 _dogfights.back()->setInterceptionsCount(_dogfights.size() + _dogfightsToBeStarted.size());
2095 }
2096 // Set correct number of interceptions for every dogfight.
2097 for(std::list<DogfightState*>::iterator d = _dogfights.begin(); d != _dogfights.end(); ++d)
2098 {
2099 (*d)->setInterceptionsCount(_dogfights.size());
2100 }
2101 }
2102}
2103
2104/**
2105 * Returns the first free dogfight slot.

Callers

nothing calls this directly

Calls 9

getZoomMethod · 0.80
isRunningMethod · 0.80
saveZoomDogfightMethod · 0.80
rotateStopMethod · 0.80
setInterceptionNumberMethod · 0.80
setInterceptionsCountMethod · 0.80
startMethod · 0.45
stopMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected