diff --git a/client/Client.cpp b/client/Client.cpp index 35f754fe6..9824065d6 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -173,6 +173,7 @@ void CClient::stop() // Tell the network thread and interface thread to reach a stable state terminate = true; LOCPLINT->terminate = true; + LOCPLINT->pim->lock(); endGame(); } diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 23c97c8bf..aa6ff18da 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -97,6 +97,8 @@ void FoWChange::applyCl( CClient *cl ) cl->playerint[player]->tileRevealed(tiles); else cl->playerint[player]->tileHidden(tiles); + + GS(cl)->calculatePaths(cl->IGameCallback::getSelectedHero(player), *cl->pathInfo); } void SetAvailableHeroes::applyCl( CClient *cl ) diff --git a/hch/CObjectHandler.cpp b/hch/CObjectHandler.cpp index 74d9affef..7df6b8111 100644 --- a/hch/CObjectHandler.cpp +++ b/hch/CObjectHandler.cpp @@ -578,7 +578,12 @@ ui8 CGHeroInstance::getSecSkillLevel(const int & ID) const } int CGHeroInstance::maxMovePoints(bool onLand) const { - int ret = std::min(2000, 1270+70*lowestSpeed(this)), + static const int moveForSpeed[] = { 1500, 1560, 1630, 1700, 1760, 1830, 1900, 1960, 2000 }; //first element for 3 and lower; last for 11 and more + int index = lowestSpeed(this) - 3; + amin(index, ARRAY_COUNT(moveForSpeed)-1); + amax(index, 0); + + int ret = moveForSpeed[index], bonus = valOfBonuses(HeroBonus::MOVEMENT) + (onLand ? valOfBonuses(HeroBonus::LAND_MOVEMENT) : valOfBonuses(HeroBonus::SEA_MOVEMENT)); double modifier = 0; diff --git a/lib/Connection.h b/lib/Connection.h index 0bab69108..bc11b3060 100644 --- a/lib/Connection.h +++ b/lib/Connection.h @@ -234,6 +234,7 @@ class CBasicPointerSaver { public: virtual void savePtr(CSaverBase &ar, const void *data) const =0; + ~CBasicPointerSaver(){} }; template class CPointerSaver : public CBasicPointerSaver @@ -263,6 +264,13 @@ public: saving=true; smartPointerSerialization = true; } + ~COSer() + { + std::map::iterator iter; + + for(iter = savers.begin(); iter != savers.end(); iter++) + delete iter->second; + } template void registerType(const T * t=NULL) { @@ -431,6 +439,7 @@ class CBasicPointerLoader { public: virtual void loadPtr(CLoaderBase &ar, void *data) const =0; //data is pointer to the ACTUAL POINTER + virtual ~CBasicPointerLoader(){} }; template class CPointerLoader : public CBasicPointerLoader