Permalink
Browse files

Revert "fix compile for C++17"

This reverts commit de86043.
  • Loading branch information...
MasterBel2
MasterBel2 committed Sep 6, 2018
1 parent de86043 commit e19d4b85b813ccecd0de8ef60b3dd14153514ebb
Showing with 23 additions and 29 deletions.
  1. +21 −27 src/spring.cpp
  2. +2 −2 src/updatehelper.cpp
@@ -15,36 +15,32 @@ lsl/spring/spring.cpp
//
// Class: Spring
//
#include "spring.h"

#include <lsl/battle/tdfcontainer.h>
#include <lslunitsync/unitsync.h>
#include <lslutils/conversion.h>
#include <lslutils/globalsmanager.h>
#include <wx/filename.h>
#include <wx/log.h>

#include <stdexcept>
#include <vector>
#include <algorithm>
#include <clocale>
#include <fstream>
#include <random>
#include <algorithm>
#include <cerrno>

#include <lsl/battle/tdfcontainer.h>
#include <lslutils/globalsmanager.h>
#include <lslutils/conversion.h>
#include <lslunitsync/unitsync.h>
#include <stdexcept>
#include <vector>

#include "spring.h"
#include "springprocess.h"
#include "gui/ui.h"
#include "gui/mainwindow.h"
#include "gui/customdialogs.h"
#include "utils/conversion.h"
#include "utils/slpaths.h"
#include "utils/slconfig.h"
#include "utils/globalevents.h"
#include "settings.h"
#include "gui/mainwindow.h"
#include "gui/ui.h"
#include "ibattle.h"
#include "log.h"

#include "settings.h"
#include "springprocess.h"
#include "utils/conversion.h"
#include "utils/globalevents.h"
#include "utils/slconfig.h"
#include "utils/slpaths.h"

SLCONFIG("/Spring/Safemode", false, "launch spring in safemode");

@@ -96,7 +92,7 @@ bool Spring::Run(IBattle& battle)

wxArrayString params;

const std::string demopath = battle.GetPlayBackFilePath();
const std::string& demopath = battle.GetPlayBackFilePath();
if (!demopath.empty()) {
params.push_back(TowxString(demopath));
return LaunchEngine(executable, params);
@@ -226,15 +222,15 @@ std::string Spring::WriteScriptTxt(IBattle& battle) const
case BT_Played:
break;
case BT_Replay: {
wxString path = TowxString(battle.GetPlayBackFilePath());
wxString path(battle.GetPlayBackFilePath());
if (path.Find(_T("/")) != wxNOT_FOUND)
path.BeforeLast(_T('/'));
tdf.AppendStr("DemoFile", STD_STRING(path));
tdf.AppendLineBreak();
break;
}
case BT_Savegame: {
wxString path = TowxString(battle.GetPlayBackFilePath());
wxString path(battle.GetPlayBackFilePath());
if (path.Find(_T("/")) != wxNOT_FOUND)
path.BeforeLast(_T('/'));
tdf.AppendStr("Savefile", STD_STRING(path));
@@ -271,9 +267,7 @@ std::string Spring::WriteScriptTxt(IBattle& battle) const
remap_positions = std::vector<LSL::StartPos>(infos.positions.begin(), infos.positions.begin() + copysize); // only add the first x positions

if (startpostype == IBattle::ST_Random) {
std::random_device seed;
std::mt19937 rng(seed());
std::shuffle(remap_positions.begin(), remap_positions.end(), rng); // shuffle the positions
std::random_shuffle(remap_positions.begin(), remap_positions.end()); // shuffle the positions
}
}
if (battle.IsProxy()) {
@@ -298,7 +292,7 @@ std::string Spring::WriteScriptTxt(IBattle& battle) const
}
tdf.LeaveSection();

std::map<std::string, int> units = battle.RestrictedUnits();
const std::map<std::string, int>& units = battle.GetRestrictedUnits();
tdf.AppendInt("NumRestrictions", units.size());
tdf.EnterSection("RESTRICT");
int restrictcount = 0;
@@ -2,12 +2,12 @@

#include "updatehelper.h"

#include <time.h>

#include "httpfile.h"
#include "utils/conversion.h"
#include "utils/slconfig.h"
#include "utils/version.h"
#include <time.h>
#include <cerrno>

SLCONFIG("/General/LastUpdateCheck", 0L, "Last time springlobby checked for an update");
SLCONFIG("/General/UpdateChannel", "release", "update channel to use (release or develop)");

0 comments on commit e19d4b8

Please sign in to comment.