To be called when battle must be started, before showing battle briefing screen In case battle is in a craft (UFO)
| 2427 | // To be called when battle must be started, before showing battle briefing screen |
| 2428 | // In case battle is in a craft (UFO) |
| 2429 | void Battle::beginBattle(GameState &state, bool hotseat, StateRef<Organisation> opponent, |
| 2430 | std::list<StateRef<Agent>> &player_agents, |
| 2431 | const std::map<StateRef<AgentType>, int> *aliens, |
| 2432 | StateRef<Vehicle> player_craft, StateRef<Vehicle> target_craft) |
| 2433 | { |
| 2434 | if (state.current_battle) |
| 2435 | { |
| 2436 | LogError("Battle::beginBattle called while another battle is in progress!"); |
| 2437 | return; |
| 2438 | } |
| 2439 | auto b = |
| 2440 | BattleMap::createBattle(state, opponent, player_agents, aliens, player_craft, target_craft); |
| 2441 | if (!b) |
| 2442 | { |
| 2443 | return; |
| 2444 | } |
| 2445 | b->locationOwner = target_craft->owner; |
| 2446 | b->hotseat = hotseat; |
| 2447 | state.current_battle = b; |
| 2448 | } |
| 2449 | |
| 2450 | // To be called when battle must be started, before showing battle briefing screen |
| 2451 | // In case battle is in a building |
nothing calls this directly
no test coverage detected