mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
parent
32597fb391
commit
c6653949e1
@ -49,6 +49,7 @@
|
||||
#include "SDL_syswm.h"
|
||||
#endif
|
||||
#include <boost/foreach.hpp>
|
||||
#include "../hch/CDefObjInfoHandler.h"
|
||||
|
||||
#if __MINGW32__
|
||||
#undef main
|
||||
@ -591,6 +592,10 @@ static void listenForEvents()
|
||||
|
||||
delete ev;
|
||||
|
||||
delete CGI->dobjinfo;
|
||||
CGI->dobjinfo = new CDefObjInfoHandler;
|
||||
CGI->dobjinfo->load();
|
||||
|
||||
GH.curInt = CGP;
|
||||
GH.defActionsDef = 63;
|
||||
continue;
|
||||
|
@ -397,6 +397,7 @@ void CMapHandler::init()
|
||||
}
|
||||
else
|
||||
n = CGI->state->capitols[i%ccc];
|
||||
|
||||
ifs >> n->name;
|
||||
if(!n)
|
||||
tlog1 << "*HUGE* Warning - missing town def for " << i << std::endl;
|
||||
|
2
global.h
2
global.h
@ -24,7 +24,7 @@ typedef si64 expType;
|
||||
#define THC
|
||||
#endif
|
||||
|
||||
#define NAME_VER ("VCMI 0.81d")
|
||||
#define NAME_VER ("VCMI 0.81e")
|
||||
extern std::string NAME; //full name
|
||||
extern std::string NAME_AFFIX; //client / server
|
||||
#define CONSOLE_LOGGING_LEVEL 5
|
||||
|
@ -59,12 +59,7 @@ public:
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & gobjs;
|
||||
|
||||
if(!h.saving) //recrete castles map
|
||||
for(std::map<int,std::map<int,CGDefInfo*> >::iterator i=gobjs.begin(); i!=gobjs.end(); i++)
|
||||
for(std::map<int,CGDefInfo*>::iterator j=i->second.begin(); j!=i->second.end(); j++)
|
||||
if(j->second->id == TOWNI_TYPE)
|
||||
castles[j->second->subid]=j->second;
|
||||
h & castles;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -311,7 +311,7 @@ bool CSmackPlayer::open( std::string name )
|
||||
buffer = new char[data->width*data->height*2];
|
||||
buf = buffer+data->width*(data->height-1)*2; // adjust pointer position for later use by 'SmackToBuffer'
|
||||
|
||||
ptrVolumePan(data, 0xfe000, 3640 * GDefaultOptions.musicVolume / 11, 0x8000); //set volume
|
||||
//ptrVolumePan(data, 0xfe000, 3640 * GDefaultOptions.musicVolume / 11, 0x8000); //set volume
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1188,6 +1188,10 @@ CGameState::~CGameState()
|
||||
//delete scenarioOps;
|
||||
delete applierGs;
|
||||
delete objCaller;
|
||||
|
||||
//TODO: delete properly that definfos
|
||||
villages.clear();
|
||||
capitols.clear();
|
||||
}
|
||||
|
||||
void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
|
||||
@ -1966,8 +1970,24 @@ void CGameState::loadTownDInfos()
|
||||
{
|
||||
villages[i] = new CGDefInfo(*VLC->dobjinfo->castles[i]);
|
||||
forts[i] = VLC->dobjinfo->castles[i];
|
||||
map->defy.push_back(forts[i]);
|
||||
capitols[i] = new CGDefInfo(*VLC->dobjinfo->castles[i]);
|
||||
}
|
||||
|
||||
std::ifstream ifs(DATA_DIR "/config/townsDefs.txt");
|
||||
int ccc;
|
||||
ifs>>ccc;
|
||||
for(int i=0; i < ccc*2; i++)
|
||||
{
|
||||
CGDefInfo *n;
|
||||
if(i<ccc)
|
||||
n = villages[i];
|
||||
else
|
||||
n = capitols[i%ccc];
|
||||
|
||||
ifs >> n->name;
|
||||
map->defy.push_back(n);
|
||||
}
|
||||
}
|
||||
|
||||
void CGameState::getNeighbours(const TerrainTile &srct, int3 tile, std::vector<int3> &vec, const boost::logic::tribool &onLand, bool limitCoastSailing)
|
||||
|
@ -446,6 +446,7 @@ public:
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & scenarioOps & seed & currentPlayer & day & map & players & hpool & globalEffects & campaign;
|
||||
h & villages & forts & capitols;
|
||||
if(!h.saving)
|
||||
{
|
||||
loadTownDInfos();
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/any.hpp>
|
||||
|
||||
const ui32 version = 725;
|
||||
const ui32 version = 726;
|
||||
class CConnection;
|
||||
class CGObjectInstance;
|
||||
class CGameState;
|
||||
|
Loading…
Reference in New Issue
Block a user