mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fixed crash on closing. Fixed #326. Max movement points values follow H3 more closely. Minor fixes.
This commit is contained in:
@@ -173,6 +173,7 @@ void CClient::stop()
|
|||||||
// Tell the network thread and interface thread to reach a stable state
|
// Tell the network thread and interface thread to reach a stable state
|
||||||
terminate = true;
|
terminate = true;
|
||||||
LOCPLINT->terminate = true;
|
LOCPLINT->terminate = true;
|
||||||
|
LOCPLINT->pim->lock();
|
||||||
endGame();
|
endGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,6 +97,8 @@ void FoWChange::applyCl( CClient *cl )
|
|||||||
cl->playerint[player]->tileRevealed(tiles);
|
cl->playerint[player]->tileRevealed(tiles);
|
||||||
else
|
else
|
||||||
cl->playerint[player]->tileHidden(tiles);
|
cl->playerint[player]->tileHidden(tiles);
|
||||||
|
|
||||||
|
GS(cl)->calculatePaths(cl->IGameCallback::getSelectedHero(player), *cl->pathInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAvailableHeroes::applyCl( CClient *cl )
|
void SetAvailableHeroes::applyCl( CClient *cl )
|
||||||
|
@@ -578,7 +578,12 @@ ui8 CGHeroInstance::getSecSkillLevel(const int & ID) const
|
|||||||
}
|
}
|
||||||
int CGHeroInstance::maxMovePoints(bool onLand) 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));
|
bonus = valOfBonuses(HeroBonus::MOVEMENT) + (onLand ? valOfBonuses(HeroBonus::LAND_MOVEMENT) : valOfBonuses(HeroBonus::SEA_MOVEMENT));
|
||||||
|
|
||||||
double modifier = 0;
|
double modifier = 0;
|
||||||
|
@@ -234,6 +234,7 @@ class CBasicPointerSaver
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void savePtr(CSaverBase &ar, const void *data) const =0;
|
virtual void savePtr(CSaverBase &ar, const void *data) const =0;
|
||||||
|
~CBasicPointerSaver(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Serializer, typename T> class CPointerSaver : public CBasicPointerSaver
|
template <typename Serializer, typename T> class CPointerSaver : public CBasicPointerSaver
|
||||||
@@ -263,6 +264,13 @@ public:
|
|||||||
saving=true;
|
saving=true;
|
||||||
smartPointerSerialization = true;
|
smartPointerSerialization = true;
|
||||||
}
|
}
|
||||||
|
~COSer()
|
||||||
|
{
|
||||||
|
std::map<ui16,CBasicPointerSaver*>::iterator iter;
|
||||||
|
|
||||||
|
for(iter = savers.begin(); iter != savers.end(); iter++)
|
||||||
|
delete iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T> void registerType(const T * t=NULL)
|
template<typename T> void registerType(const T * t=NULL)
|
||||||
{
|
{
|
||||||
@@ -431,6 +439,7 @@ class CBasicPointerLoader
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void loadPtr(CLoaderBase &ar, void *data) const =0; //data is pointer to the ACTUAL POINTER
|
virtual void loadPtr(CLoaderBase &ar, void *data) const =0; //data is pointer to the ACTUAL POINTER
|
||||||
|
virtual ~CBasicPointerLoader(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Serializer, typename T> class CPointerLoader : public CBasicPointerLoader
|
template <typename Serializer, typename T> class CPointerLoader : public CBasicPointerLoader
|
||||||
|
Reference in New Issue
Block a user