1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fixed desync.

Version bumped to 0.82c
This commit is contained in:
Michał W. Urbańczyk 2010-10-27 11:36:14 +00:00
parent d823b18c72
commit c299a1cdea
4 changed files with 41 additions and 13 deletions

View File

@ -1,3 +1,26 @@
0.82 -> 0.83
GENERAL:
* Alliances support
* Week of / Month of events
* Mostly done pregame for MP games (temporarily only for local clients)
* Support for 16bpp displays
* Campaigns:
- support for building bonus
- moving to next map after victory
* Town Portal supported
* Vial of Dragon Blood supported
HERO:
* remaining specialities have been implemented
TOWNS:
* town events supported
* Support for new town structures: Deiety of Fire and Escape Tunnel
BATTLES:
* blocked retreating from castle
0.81 -> 0.82 (Aug 01 2010)
GENERAL:
* Some of the starting bonuses in campaigns are supported

View File

@ -1371,6 +1371,7 @@ CGameState::~CGameState()
delete map;
delete curB;
delete scenarioOps;
delete initialOpts;
delete applierGs;
delete objCaller;
@ -1381,7 +1382,6 @@ CGameState::~CGameState()
void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
{
VLC->creh->globalEffects = &globalEffects;
struct HLP
{
//it's assumed that given hero should receive the bonus
@ -1466,24 +1466,32 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
}
};
switch(si->mode)
seed = Seed;
ran.seed((boost::int32_t)seed);
VLC->creh->globalEffects = &globalEffects;
scenarioOps = new StartInfo(*si);
initialOpts = new StartInfo(*si);
si = NULL;
switch(scenarioOps->mode)
{
case StartInfo::NEW_GAME:
map = new Mapa(si->mapname);
map = new Mapa(scenarioOps->mapname);
break;
case StartInfo::CAMPAIGN:
{
campaign = new CCampaignState();
campaign->initNewCampaign(*si);
assert(vstd::contains(campaign->camp->mapPieces, si->whichMapInCampaign));
campaign->initNewCampaign(*scenarioOps);
assert(vstd::contains(campaign->camp->mapPieces, scenarioOps->whichMapInCampaign));
std::string &mapContent = campaign->camp->mapPieces[si->whichMapInCampaign];
std::string &mapContent = campaign->camp->mapPieces[scenarioOps->whichMapInCampaign];
map = new Mapa();
map->initFromBytes((const unsigned char*)mapContent.c_str());
}
break;
default:
tlog1 << "Wrong mode: " << (int)si->mode << std::endl;
tlog1 << "Wrong mode: " << (int)scenarioOps->mode << std::endl;
return;
}
VLC->arth->initAllowedArtifactsList(map->allowedArtifact);
@ -1493,7 +1501,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
//tlog0 <<"Reading and detecting map file (together): "<<tmh.getDif()<<std::endl;
if(checksum)
{
tlog0 << "\tServer checksum for " << si->mapname <<": "<< checksum << std::endl;
tlog0 << "\tServer checksum for " << scenarioOps->mapname <<": "<< checksum << std::endl;
tlog0 << "\tOur checksum for the map: "<< map->checksum << std::endl;
if(map->checksum != checksum)
{
@ -1503,9 +1511,6 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
}
day = 0;
seed = Seed;
ran.seed((boost::int32_t)seed);
scenarioOps = new StartInfo(*si);
loadTownDInfos();
//pick grail location

View File

@ -388,7 +388,7 @@ struct DLL_EXPORT CPathsInfo
class DLL_EXPORT CGameState
{
public:
StartInfo* scenarioOps;
StartInfo* scenarioOps, *initialOpts; //second one is a copy of settings received from pregame (not randomized)
CCampaignState *campaign;
ui32 seed;
ui8 currentPlayer; //ID of player currently having turn

View File

@ -1330,7 +1330,7 @@ void CGameHandler::run(bool resume)
ui8 pom;
//ui32 seed;
if(!resume)
(*cc) << gs->scenarioOps << gs->map->checksum << gs->seed; // gs->scenarioOps
(*cc) << gs->initialOpts << gs->map->checksum << gs->seed; // gs->scenarioOps
(*cc) >> quantity; //how many players will be handled at that client