mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
* a bit of campaign support
This commit is contained in:
@ -1629,6 +1629,7 @@ int3 CAdvMapInt::verifyPos(int3 ver)
|
|||||||
|
|
||||||
void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
|
void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
|
||||||
{
|
{
|
||||||
|
assert(sel);
|
||||||
LOCPLINT->cb->setSelection(sel);
|
LOCPLINT->cb->setSelection(sel);
|
||||||
selection = sel;
|
selection = sel;
|
||||||
if(centerView)
|
if(centerView)
|
||||||
|
@ -601,15 +601,17 @@ void startGame(StartInfo * options)
|
|||||||
setResolution = true;
|
setResolution = true;
|
||||||
|
|
||||||
client = new CClient;
|
client = new CClient;
|
||||||
if(options->mode == 0) //new game
|
switch(options->mode) //new game
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
|
case 2:
|
||||||
client->newGame(NULL, options);
|
client->newGame(NULL, options);
|
||||||
}
|
break;
|
||||||
else //load game
|
case 1:
|
||||||
{
|
|
||||||
std::string fname = options->mapname;
|
std::string fname = options->mapname;
|
||||||
boost::algorithm::erase_last(fname,".vlgm1");
|
boost::algorithm::erase_last(fname,".vlgm1");
|
||||||
client->loadGame(fname);
|
client->loadGame(fname);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGI->musich->stopMusic();
|
CGI->musich->stopMusic();
|
||||||
|
@ -2204,7 +2204,7 @@ CBonusSelection::CBonusSelection( const CCampaign * _ourCampaign, int _whichMap
|
|||||||
|
|
||||||
blitAt(panel, 456, 6, background);
|
blitAt(panel, 456, 6, background);
|
||||||
|
|
||||||
startB = new AdventureMapButton("", "", 0 /*cb*/, 475, 536, "SCNRBEG.DEF", SDLK_RETURN);
|
startB = new AdventureMapButton("", "", bind(&CBonusSelection::startMap, this), 475, 536, "SCNRBEG.DEF", SDLK_RETURN);
|
||||||
backB = new AdventureMapButton("", "", bind(&CBonusSelection::goBack, this), 624, 536, "SCNRBACK.DEF", SDLK_ESCAPE);
|
backB = new AdventureMapButton("", "", bind(&CBonusSelection::goBack, this), 624, 536, "SCNRBACK.DEF", SDLK_ESCAPE);
|
||||||
|
|
||||||
//campaign name
|
//campaign name
|
||||||
@ -2320,7 +2320,7 @@ void CBonusSelection::loadPositionsOfGraphics()
|
|||||||
void CBonusSelection::selectMap( int whichOne )
|
void CBonusSelection::selectMap( int whichOne )
|
||||||
{
|
{
|
||||||
sInfo.difficulty = ourCampaign->scenarios[whichOne].difficulty;
|
sInfo.difficulty = ourCampaign->scenarios[whichOne].difficulty;
|
||||||
sInfo.mapname = ourCampaign->header.name;
|
sInfo.mapname = ourCampaign->header.filename;
|
||||||
sInfo.mode = 2;
|
sInfo.mode = 2;
|
||||||
|
|
||||||
//get header
|
//get header
|
||||||
@ -2328,9 +2328,12 @@ void CBonusSelection::selectMap( int whichOne )
|
|||||||
delete ourHeader;
|
delete ourHeader;
|
||||||
ourHeader = new CMapHeader();
|
ourHeader = new CMapHeader();
|
||||||
ourHeader->initFromMemory((const unsigned char*)ourCampaign->mapPieces[whichOne].c_str(), i);
|
ourHeader->initFromMemory((const unsigned char*)ourCampaign->mapPieces[whichOne].c_str(), i);
|
||||||
const_cast<CMapInfo *>(curMap)->playerAmnt = ourHeader->players.size();
|
CMapInfo *mapInfo = const_cast<CMapInfo *>(curMap);
|
||||||
|
mapInfo->mapHeader = ourHeader;
|
||||||
|
mapInfo->countPlayers();
|
||||||
|
mapInfo->mapHeader = NULL;
|
||||||
|
|
||||||
CSelectionScreen::updateStartInfo(curMap, *curOpts, ourHeader);
|
CSelectionScreen::updateStartInfo(curMap, sInfo, ourHeader);
|
||||||
sInfo.turnTime = 0;
|
sInfo.turnTime = 0;
|
||||||
sInfo.whichMapInCampaign = whichOne;
|
sInfo.whichMapInCampaign = whichOne;
|
||||||
}
|
}
|
||||||
@ -2409,6 +2412,14 @@ void CBonusSelection::updateBonusSelection()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBonusSelection::startMap()
|
||||||
|
{
|
||||||
|
StartInfo *si = new StartInfo(sInfo);
|
||||||
|
GH.popInts(3);
|
||||||
|
curOpts = NULL;
|
||||||
|
::startGame(si);
|
||||||
|
}
|
||||||
|
|
||||||
CBonusSelection::CRegion::CRegion( CBonusSelection * _owner, bool _accessible, bool _selectable, int _myNumber )
|
CBonusSelection::CRegion::CRegion( CBonusSelection * _owner, bool _accessible, bool _selectable, int _myNumber )
|
||||||
: owner(_owner), accessible(_accessible), selectable(_selectable), myNumber(_myNumber)
|
: owner(_owner), accessible(_accessible), selectable(_selectable), myNumber(_myNumber)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "../hch/CCampaignHandler.h"
|
||||||
#include "../CCallback.h"
|
#include "../CCallback.h"
|
||||||
#include "../CConsoleHandler.h"
|
#include "../CConsoleHandler.h"
|
||||||
#include "CGameInfo.h"
|
#include "CGameInfo.h"
|
||||||
@ -375,32 +376,21 @@ void CClient::newGame( CConnection *con, StartInfo *si )
|
|||||||
|
|
||||||
|
|
||||||
ui32 seed, sum;
|
ui32 seed, sum;
|
||||||
std::string mapname;
|
delete si;
|
||||||
c >> mapname >> sum >> seed;
|
c >> si >> sum >> seed;
|
||||||
tlog0 <<"\tSending/Getting info to/from the server: "<<tmh.getDif()<<std::endl;
|
tlog0 <<"\tSending/Getting info to/from the server: "<<tmh.getDif()<<std::endl;
|
||||||
|
|
||||||
Mapa * mapa = new Mapa(mapname);
|
|
||||||
tlog0 <<"Reading and detecting map file (together): "<<tmh.getDif()<<std::endl;
|
|
||||||
tlog0 << "\tServer checksum for "<<mapname <<": "<<sum << std::endl;
|
|
||||||
tlog0 << "\tOur checksum for the map: "<< mapa->checksum << std::endl;
|
|
||||||
|
|
||||||
if(mapa->checksum != sum)
|
|
||||||
{
|
|
||||||
tlog1 << "Wrong map checksum!!!" << std::endl;
|
|
||||||
throw std::string("Wrong checksum");
|
|
||||||
}
|
|
||||||
tlog0 << "\tUsing random seed: "<<seed << std::endl;
|
tlog0 << "\tUsing random seed: "<<seed << std::endl;
|
||||||
|
|
||||||
gs = CGI->state;
|
gs = CGI->state;
|
||||||
gs->scenarioOps = si;
|
gs->scenarioOps = si;
|
||||||
gs->init(si,mapa,seed);
|
gs->init(si, sum, seed);
|
||||||
|
|
||||||
CGI->mh = new CMapHandler();
|
CGI->mh = new CMapHandler();
|
||||||
tlog0 <<"Initializing GameState (together): "<<tmh.getDif()<<std::endl;
|
tlog0 <<"Initializing GameState (together): "<<tmh.getDif()<<std::endl;
|
||||||
CGI->mh->map = mapa;
|
CGI->mh->map = gs->map;
|
||||||
tlog0 <<"Creating mapHandler: "<<tmh.getDif()<<std::endl;
|
tlog0 <<"Creating mapHandler: "<<tmh.getDif()<<std::endl;
|
||||||
CGI->mh->init();
|
CGI->mh->init();
|
||||||
pathInfo = new CPathsInfo(int3(mapa->width, mapa->height, mapa->twoLevel+1));
|
pathInfo = new CPathsInfo(int3(gs->map->width, gs->map->height, gs->map->twoLevel+1));
|
||||||
tlog0 <<"Initializing mapHandler (together): "<<tmh.getDif()<<std::endl;
|
tlog0 <<"Initializing mapHandler (together): "<<tmh.getDif()<<std::endl;
|
||||||
|
|
||||||
int humanPlayers = 0;
|
int humanPlayers = 0;
|
||||||
|
@ -75,7 +75,7 @@ void CGuiHandler::popInts( int howMany )
|
|||||||
{
|
{
|
||||||
if(!howMany) return; //senseless but who knows...
|
if(!howMany) return; //senseless but who knows...
|
||||||
|
|
||||||
assert(listInt.size() > howMany);
|
assert(listInt.size() >= howMany);
|
||||||
listInt.front()->deactivate();
|
listInt.front()->deactivate();
|
||||||
for(int i=0; i < howMany; i++)
|
for(int i=0; i < howMany; i++)
|
||||||
{
|
{
|
||||||
@ -83,8 +83,12 @@ void CGuiHandler::popInts( int howMany )
|
|||||||
delete listInt.front();
|
delete listInt.front();
|
||||||
listInt.pop_front();
|
listInt.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(listInt.size())
|
||||||
|
{
|
||||||
listInt.front()->activate();
|
listInt.front()->activate();
|
||||||
totalRedraw();
|
totalRedraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IShowActivable * CGuiHandler::topInt()
|
IShowActivable * CGuiHandler::topInt()
|
||||||
|
@ -1504,7 +1504,7 @@ void CHeroList::draw(SDL_Surface * to)
|
|||||||
blitAt(mana->ourImages[pom].bitmap,posmanx,posmany+i*32,to); //mana
|
blitAt(mana->ourImages[pom].bitmap,posmanx,posmany+i*32,to); //mana
|
||||||
SDL_Surface * temp = graphics->portraitSmall[cur->portrait];
|
SDL_Surface * temp = graphics->portraitSmall[cur->portrait];
|
||||||
blitAt(temp,posporx,pospory+i*32,to);
|
blitAt(temp,posporx,pospory+i*32,to);
|
||||||
if ((selected == iT) && (adventureInt->selection->ID == HEROI_TYPE))
|
if (adventureInt->selection && (selected == iT) && (adventureInt->selection->ID == HEROI_TYPE))
|
||||||
{
|
{
|
||||||
blitAt(selection,posporx,pospory+i*32,to);
|
blitAt(selection,posporx,pospory+i*32,to);
|
||||||
}
|
}
|
||||||
@ -1745,7 +1745,7 @@ void CTownList::draw(SDL_Surface * to)
|
|||||||
|
|
||||||
blitAt(graphics->getPic(LOCPLINT->towns[iT]->subID,LOCPLINT->towns[iT]->hasFort(),LOCPLINT->towns[iT]->builded),posporx,pospory+i*32,to);
|
blitAt(graphics->getPic(LOCPLINT->towns[iT]->subID,LOCPLINT->towns[iT]->hasFort(),LOCPLINT->towns[iT]->builded),posporx,pospory+i*32,to);
|
||||||
|
|
||||||
if ((selected == iT) && (adventureInt->selection->ID == TOWNI_TYPE))
|
if (adventureInt->selection && (selected == iT) && (adventureInt->selection->ID == TOWNI_TYPE))
|
||||||
{
|
{
|
||||||
blitAt(graphics->getPic(-2),posporx,pospory+i*32,to);
|
blitAt(graphics->getPic(-2),posporx,pospory+i*32,to);
|
||||||
}
|
}
|
||||||
|
@ -436,3 +436,8 @@ bool CCampaign::conquerable( int whichScenario ) const
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCampaign::CCampaign()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -114,6 +114,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool conquerable(int whichScenario) const;
|
bool conquerable(int whichScenario) const;
|
||||||
|
|
||||||
|
CCampaign();
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_EXPORT CCampaignHandler
|
class DLL_EXPORT CCampaignHandler
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#define VCMI_DLL
|
#define VCMI_DLL
|
||||||
|
#include "../hch/CCampaignHandler.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -1162,6 +1163,7 @@ CGameState::CGameState()
|
|||||||
scenarioOps = NULL;
|
scenarioOps = NULL;
|
||||||
applierGs = new CGSApplier;
|
applierGs = new CGSApplier;
|
||||||
objCaller = new CObjectCallersHandler;
|
objCaller = new CObjectCallersHandler;
|
||||||
|
campaign = NULL;
|
||||||
}
|
}
|
||||||
CGameState::~CGameState()
|
CGameState::~CGameState()
|
||||||
{
|
{
|
||||||
@ -1172,13 +1174,40 @@ CGameState::~CGameState()
|
|||||||
delete applierGs;
|
delete applierGs;
|
||||||
delete objCaller;
|
delete objCaller;
|
||||||
}
|
}
|
||||||
void CGameState::init(StartInfo * si, Mapa * map, int Seed)
|
void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
switch(si->mode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
map = new Mapa(si->mapname);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
campaign = new CCampaignState();
|
||||||
|
campaign->initNewCampaign(*si);
|
||||||
|
std::string &mapContent = campaign->camp->mapPieces[si->whichMapInCampaign];
|
||||||
|
map = new Mapa();
|
||||||
|
map->initFromBytes((const unsigned char*)mapContent.c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tlog0 << "Map loaded!" << std::endl;
|
||||||
|
|
||||||
|
//tlog0 <<"Reading and detecting map file (together): "<<tmh.getDif()<<std::endl;
|
||||||
|
if(checksum)
|
||||||
|
{
|
||||||
|
tlog0 << "\tServer checksum for " << si->mapname <<": "<< checksum << std::endl;
|
||||||
|
tlog0 << "\tOur checksum for the map: "<< map->checksum << std::endl;
|
||||||
|
if(map->checksum != checksum)
|
||||||
|
{
|
||||||
|
tlog1 << "Wrong map checksum!!!" << std::endl;
|
||||||
|
throw std::string("Wrong checksum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
day = 0;
|
day = 0;
|
||||||
seed = Seed;
|
seed = Seed;
|
||||||
ran.seed((boost::int32_t)seed);
|
ran.seed((boost::int32_t)seed);
|
||||||
scenarioOps = si;
|
scenarioOps = si;
|
||||||
this->map = map;
|
|
||||||
loadTownDInfos();
|
loadTownDInfos();
|
||||||
|
|
||||||
//pick grail location
|
//pick grail location
|
||||||
@ -3798,3 +3827,14 @@ InfoAboutHero & InfoAboutHero::operator=( const InfoAboutHero & iah )
|
|||||||
assign(iah);
|
assign(iah);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCampaignState::initNewCampaign( const StartInfo &si )
|
||||||
|
{
|
||||||
|
assert(si.mode == 2);
|
||||||
|
campaignName = si.mapname;
|
||||||
|
currentMap = si.whichMapInCampaign;
|
||||||
|
|
||||||
|
camp = CCampaignHandler::getCampaign(campaignName, true); //TODO lod???
|
||||||
|
for (ui8 i = 0; i < camp->mapPieces.size(); i++)
|
||||||
|
mapsRemaining.push_back(i);
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ struct CPack;
|
|||||||
class CSpell;
|
class CSpell;
|
||||||
struct TerrainTile;
|
struct TerrainTile;
|
||||||
class CHeroClass;
|
class CHeroClass;
|
||||||
|
class CCampaign;
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@ -345,10 +346,27 @@ struct DLL_EXPORT CPathsInfo
|
|||||||
~CPathsInfo();
|
~CPathsInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DLL_EXPORT CCampaignState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CCampaign *camp;
|
||||||
|
std::string campaignName;
|
||||||
|
std::vector<ui8> mapsConquered, mapsRemaining;
|
||||||
|
ui8 currentMap;
|
||||||
|
|
||||||
|
void initNewCampaign(const StartInfo &si);
|
||||||
|
|
||||||
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
|
{
|
||||||
|
h & camp & campaignName & mapsRemaining & mapsConquered & currentMap;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class DLL_EXPORT CGameState
|
class DLL_EXPORT CGameState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StartInfo* scenarioOps;
|
StartInfo* scenarioOps;
|
||||||
|
CCampaignState *campaign;
|
||||||
ui32 seed;
|
ui32 seed;
|
||||||
ui8 currentPlayer; //ID of player currently having turn
|
ui8 currentPlayer; //ID of player currently having turn
|
||||||
BattleInfo *curB; //current battle
|
BattleInfo *curB; //current battle
|
||||||
@ -375,7 +393,7 @@ public:
|
|||||||
boost::shared_mutex *mx;
|
boost::shared_mutex *mx;
|
||||||
PlayerState *getPlayer(ui8 color, bool verbose = true);
|
PlayerState *getPlayer(ui8 color, bool verbose = true);
|
||||||
const PlayerState *getPlayer(ui8 color, bool verbose = true) const;
|
const PlayerState *getPlayer(ui8 color, bool verbose = true) const;
|
||||||
void init(StartInfo * si, Mapa * map, int Seed);
|
void init(StartInfo * si, ui32 checksum, int Seed);
|
||||||
void loadTownDInfos();
|
void loadTownDInfos();
|
||||||
void randomizeObject(CGObjectInstance *cur);
|
void randomizeObject(CGObjectInstance *cur);
|
||||||
std::pair<int,int> pickObject(CGObjectInstance *obj); //chooses type of object to be randomized, returns <type, subtype>
|
std::pair<int,int> pickObject(CGObjectInstance *obj); //chooses type of object to be randomized, returns <type, subtype>
|
||||||
@ -419,7 +437,7 @@ public:
|
|||||||
int getDate(int mode=0) const; //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
|
int getDate(int mode=0) const; //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & scenarioOps & seed & currentPlayer & day & map & players & resVals & hpool & globalEffects;
|
h & scenarioOps & seed & currentPlayer & day & map & players & resVals & hpool & globalEffects & campaign;
|
||||||
if(!h.saving)
|
if(!h.saving)
|
||||||
{
|
{
|
||||||
loadTownDInfos();
|
loadTownDInfos();
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <boost/mpl/int.hpp>
|
#include <boost/mpl/int.hpp>
|
||||||
#include <boost/mpl/identity.hpp>
|
#include <boost/mpl/identity.hpp>
|
||||||
|
|
||||||
const ui32 version = 719;
|
const ui32 version = 720;
|
||||||
class CConnection;
|
class CConnection;
|
||||||
class CGObjectInstance;
|
class CGObjectInstance;
|
||||||
class CGameState;
|
class CGameState;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "../hch/CCampaignHandler.h"
|
||||||
#include "../StartInfo.h"
|
#include "../StartInfo.h"
|
||||||
#include "../hch/CArtHandler.h"
|
#include "../hch/CArtHandler.h"
|
||||||
#include "../hch/CBuildingHandler.h"
|
#include "../hch/CBuildingHandler.h"
|
||||||
@ -851,11 +852,9 @@ CGameHandler::~CGameHandler(void)
|
|||||||
|
|
||||||
void CGameHandler::init(StartInfo *si, int Seed)
|
void CGameHandler::init(StartInfo *si, int Seed)
|
||||||
{
|
{
|
||||||
Mapa *map = new Mapa(si->mapname);
|
|
||||||
tlog0 << "Map loaded!" << std::endl;
|
|
||||||
gs = new CGameState();
|
gs = new CGameState();
|
||||||
tlog0 << "Gamestate created!" << std::endl;
|
tlog0 << "Gamestate created!" << std::endl;
|
||||||
gs->init(si,map,Seed);
|
gs->init(si, 0, Seed);
|
||||||
tlog0 << "Gamestate initialized!" << std::endl;
|
tlog0 << "Gamestate initialized!" << std::endl;
|
||||||
|
|
||||||
for(std::map<ui8,PlayerState>::iterator i = gs->players.begin(); i != gs->players.end(); i++)
|
for(std::map<ui8,PlayerState>::iterator i = gs->players.begin(); i != gs->players.end(); i++)
|
||||||
@ -1044,7 +1043,7 @@ void CGameHandler::run(bool resume)
|
|||||||
ui8 quantity, pom;
|
ui8 quantity, pom;
|
||||||
//ui32 seed;
|
//ui32 seed;
|
||||||
if(!resume)
|
if(!resume)
|
||||||
(*cc) << gs->scenarioOps->mapname << gs->map->checksum << gs->seed;
|
(*cc) << gs->scenarioOps << gs->map->checksum << gs->seed;
|
||||||
|
|
||||||
(*cc) >> quantity; //how many players will be handled at that client
|
(*cc) >> quantity; //how many players will be handled at that client
|
||||||
for(int i=0;i<quantity;i++)
|
for(int i=0;i<quantity;i++)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "../hch/CCampaignHandler.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
@ -71,6 +72,7 @@ void CVCMIServer::newGame(CConnection *c)
|
|||||||
*c >> clients; //how many clients should be connected - TODO: support more than one
|
*c >> clients; //how many clients should be connected - TODO: support more than one
|
||||||
*c >> *si; //get start options
|
*c >> *si; //get start options
|
||||||
int problem;
|
int problem;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
FILE *f;
|
FILE *f;
|
||||||
problem = fopen_s(&f,si->mapname.c_str(),"r");
|
problem = fopen_s(&f,si->mapname.c_str(),"r");
|
||||||
@ -78,13 +80,14 @@ void CVCMIServer::newGame(CConnection *c)
|
|||||||
FILE * f = fopen(si->mapname.c_str(),"r");
|
FILE * f = fopen(si->mapname.c_str(),"r");
|
||||||
problem = !f;
|
problem = !f;
|
||||||
#endif
|
#endif
|
||||||
if(problem)
|
if(problem && si->mode == 0) //TODO some checking for campaigns
|
||||||
{
|
{
|
||||||
*c << ui8(problem); //WRONG!
|
*c << ui8(problem); //WRONG!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(f)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
*c << ui8(0); //OK!
|
*c << ui8(0); //OK!
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user