 
         # Return to port
         when '/kcsapi/api_port/port'
-          flag = true
+          shouldRender = true
           goBack = Object.clone initData
           combinedFlag = body.api_combined_flag
           combinedFlag ?= 0

      sortieHp.now[i] = _ships[shipId].api_nowhp
      sortieHp.max[i] = _ships[shipId].api_maxhp

simulateKouku = (api_kouku, planeCount) ->
  if api_kouku.api_stage2?
    planeCount.sortie[0] -= api_kouku.api_stage2.api_f_lostcount
    planeCount.enemy[0] -= api_kouku.api_stage2.api_e_lostcount


simulateBattle = (sortieHp, enemyHp, combinedHp, isCombined, isWater, body, leastHp, planeCount, sortieInfo, combinedInfo, mvpPos) ->
  # First air battle

  if body.api_kouku?


        # Combined battle
        when '/kcsapi/api_req_combined_battle/airbattle', '/kcsapi/api_req_combined_battle/sp_midnight', '/kcsapi/api_req_combined_battle/battle', '/kcsapi/api_req_combined_battle/battle_water', '/kcsapi/api_req_combined_battle/midnight_battle'
          shouldRender = true
          escapeId = towId = -1
          isSurface = false
          # If water combined
          if path == '/kcsapi/api_req_combined_battle/battle_water'
            isSurface = true
          daySortieDmg = Object.clone sortieHp.dmg
          dayEnemyDmg = Object.clone enemyHp.dmg
          dayCombinedDmg = Object.clone combinedHp.dmg
          if path != '/kcsapi/api_req_combined_battle/midnight_battle'
            getEnemyInfo enemyHp, enemyInfo, body, false
          result = simulateBattle sortieHp, enemyHp, combinedHp, true, isSurface, body, 1, planeCount, sortieInfo, combinedInfo, mvpPos
          for i in [0..5]
            sortieHp.dmg[i] -= daySortieDmg[i]
            enemyHp.dmg[i] -= dayEnemyDmg[i]
