mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fixed crash on closing. Fixed #326. Max movement points values follow H3 more closely. Minor fixes.
This commit is contained in:
parent
d50a3785bd
commit
5be449b6ca
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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 )
|
||||
|
@ -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;
|
||||
|
@ -234,6 +234,7 @@ class CBasicPointerSaver
|
||||
{
|
||||
public:
|
||||
virtual void savePtr(CSaverBase &ar, const void *data) const =0;
|
||||
~CBasicPointerSaver(){}
|
||||
};
|
||||
|
||||
template <typename Serializer, typename T> class CPointerSaver : public CBasicPointerSaver
|
||||
@ -263,6 +264,13 @@ public:
|
||||
saving=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)
|
||||
{
|
||||
@ -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 <typename Serializer, typename T> class CPointerLoader : public CBasicPointerLoader
|
||||
|
Loading…
Reference in New Issue
Block a user