1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

#1153 and #1395 should be fixed. Terrible, terrible, terrible.

Fixed crash in battles, when attempted to access <0 screen coordinates.
This commit is contained in:
Michał W. Urbańczyk
2013-09-01 22:55:57 +00:00
parent 708b0c6f47
commit 385f4ab7f5
6 changed files with 53 additions and 31 deletions

View File

@@ -190,7 +190,6 @@ void CClient::endGame( bool closeConnection /*= true*/ )
logNetwork->infoStream() << "Closed connection.";
GH.curInt = nullptr;
LOCPLINT->terminate_cond.setn(true);
{
boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);
logNetwork->infoStream() << "Ending current game!";
@@ -606,9 +605,11 @@ void CClient::battleStarted(const BattleInfo * info)
if(!gNoGUI && (!!att || !!def || gs->scenarioOps->mode == StartInfo::DUEL))
{
boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);
new CBattleInterface(leftSide.armyObject, rightSide.armyObject, leftSide.hero, rightSide.hero,
auto bi = new CBattleInterface(leftSide.armyObject, rightSide.armyObject, leftSide.hero, rightSide.hero,
Rect((screen->w - 800)/2,
(screen->h - 600)/2, 800, 600), att, def);
GH.pushInt(bi);
}
auto callBattleStart = [&](PlayerColor color, ui8 side){