mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +02:00
Crashes on starting next campaign mission should be fixed.
This commit is contained in:
parent
f3f4a7633d
commit
ecd8947d8e
@ -1380,7 +1380,8 @@ void CAdvMapInt::tileHovered(const int3 &mapPos)
|
|||||||
if (guardingCreature)
|
if (guardingCreature)
|
||||||
{
|
{
|
||||||
CCS->curh->changeGraphic(0, 5 + turns*6);
|
CCS->curh->changeGraphic(0, 5 + turns*6);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if(pnode->land)
|
if(pnode->land)
|
||||||
{
|
{
|
||||||
|
@ -334,6 +334,8 @@ void CClient::newGame( CConnection *con, StartInfo *si )
|
|||||||
|
|
||||||
c >> si;
|
c >> si;
|
||||||
tlog0 <<"\tSending/Getting info to/from the server: "<<tmh.getDiff()<<std::endl;
|
tlog0 <<"\tSending/Getting info to/from the server: "<<tmh.getDiff()<<std::endl;
|
||||||
|
c.enableStackSendingByID();
|
||||||
|
c.disableSmartPointerSerialization();
|
||||||
|
|
||||||
gs = const_cast<CGameInfo*>(CGI)->state;
|
gs = const_cast<CGameInfo*>(CGI)->state;
|
||||||
gs->scenarioOps = si;
|
gs->scenarioOps = si;
|
||||||
|
@ -55,10 +55,8 @@ CTypeList typeList;
|
|||||||
|
|
||||||
void CConnection::init()
|
void CConnection::init()
|
||||||
{
|
{
|
||||||
CISer<CConnection>::smartPointerSerialization = false;
|
enableSmartPointerSerializatoin();
|
||||||
COSer<CConnection>::smartPointerSerialization = false;
|
disableStackSendingByID();
|
||||||
CISer<CConnection>::sendStackInstanceByIds = true;
|
|
||||||
COSer<CConnection>::sendStackInstanceByIds = true;
|
|
||||||
registerTypes(static_cast<CISer<CConnection>&>(*this));
|
registerTypes(static_cast<CISer<CConnection>&>(*this));
|
||||||
registerTypes(static_cast<COSer<CConnection>&>(*this));
|
registerTypes(static_cast<COSer<CConnection>&>(*this));
|
||||||
#ifdef LIL_ENDIAN
|
#ifdef LIL_ENDIAN
|
||||||
@ -250,6 +248,30 @@ void CConnection::sendPackToServer(const CPack &pack, ui8 player, ui32 requestID
|
|||||||
*this << player << requestID << &pack; //packs has to be sent as polymorphic pointers!
|
*this << player << requestID << &pack; //packs has to be sent as polymorphic pointers!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CConnection::disableStackSendingByID()
|
||||||
|
{
|
||||||
|
CISer<CConnection>::sendStackInstanceByIds = false;
|
||||||
|
COSer<CConnection>::sendStackInstanceByIds = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CConnection::enableStackSendingByID()
|
||||||
|
{
|
||||||
|
CISer<CConnection>::sendStackInstanceByIds = true;
|
||||||
|
COSer<CConnection>::sendStackInstanceByIds = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CConnection::disableSmartPointerSerialization()
|
||||||
|
{
|
||||||
|
CISer<CConnection>::smartPointerSerialization = false;
|
||||||
|
COSer<CConnection>::smartPointerSerialization = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CConnection::enableSmartPointerSerializatoin()
|
||||||
|
{
|
||||||
|
CISer<CConnection>::smartPointerSerialization = true;
|
||||||
|
COSer<CConnection>::smartPointerSerialization = true;
|
||||||
|
}
|
||||||
|
|
||||||
CSaveFile::CSaveFile( const std::string &fname )
|
CSaveFile::CSaveFile( const std::string &fname )
|
||||||
{
|
{
|
||||||
registerTypes(*this);
|
registerTypes(*this);
|
||||||
|
@ -1087,6 +1087,11 @@ public:
|
|||||||
|
|
||||||
CPack *retreivePack(); //gets from server next pack (allocates it with new)
|
CPack *retreivePack(); //gets from server next pack (allocates it with new)
|
||||||
void sendPackToServer(const CPack &pack, ui8 player, ui32 requestID);
|
void sendPackToServer(const CPack &pack, ui8 player, ui32 requestID);
|
||||||
|
|
||||||
|
void disableStackSendingByID();
|
||||||
|
void enableStackSendingByID();
|
||||||
|
void disableSmartPointerSerialization();
|
||||||
|
void enableSmartPointerSerializatoin();
|
||||||
};
|
};
|
||||||
|
|
||||||
DLL_LINKAGE std::ostream &operator<<(std::ostream &str, const CConnection &cpc);
|
DLL_LINKAGE std::ostream &operator<<(std::ostream &str, const CConnection &cpc);
|
||||||
|
@ -1480,6 +1480,10 @@ void CGameHandler::run(bool resume)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tlog0 << std::endl;
|
tlog0 << std::endl;
|
||||||
|
|
||||||
|
cc->addStdVecItems(gs);
|
||||||
|
cc->enableStackSendingByID();
|
||||||
|
cc->disableSmartPointerSerialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::set<CConnection*>::iterator i = conns.begin(); i!=conns.end();i++)
|
for(std::set<CConnection*>::iterator i = conns.begin(); i!=conns.end();i++)
|
||||||
|
@ -328,7 +328,6 @@ CGameHandler * CVCMIServer::initGhFromHostingConnection(CConnection &c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gh->init(&si);
|
gh->init(&si);
|
||||||
c.addStdVecItems(gh->gs);
|
|
||||||
gh->conns.insert(&c);
|
gh->conns.insert(&c);
|
||||||
|
|
||||||
return gh;
|
return gh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user