mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-31 22:05:10 +02:00
Add reset to some static variables on client
This commit is contained in:
parent
f020fa06fd
commit
a90b657b86
@ -240,6 +240,8 @@ void CClient::endGame( bool closeConnection /*= true*/ )
|
|||||||
battleints.clear();
|
battleints.clear();
|
||||||
callbacks.clear();
|
callbacks.clear();
|
||||||
battleCallbacks.clear();
|
battleCallbacks.clear();
|
||||||
|
CGKeys::reset();
|
||||||
|
CGMagi::reset();
|
||||||
CGObelisk::reset();
|
CGObelisk::reset();
|
||||||
logNetwork->infoStream() << "Deleted playerInts.";
|
logNetwork->infoStream() << "Deleted playerInts.";
|
||||||
logNetwork->infoStream() << "Client stopped.";
|
logNetwork->infoStream() << "Client stopped.";
|
||||||
|
@ -762,6 +762,11 @@ void CGQuestGuard::completeQuest(const CGHeroInstance *h) const
|
|||||||
cb->removeObject(this);
|
cb->removeObject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGKeys::reset()
|
||||||
|
{
|
||||||
|
playerKeyMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CGKeys::setPropertyDer (ui8 what, ui32 val) //101-108 - enable key for player 1-8
|
void CGKeys::setPropertyDer (ui8 what, ui32 val) //101-108 - enable key for player 1-8
|
||||||
{
|
{
|
||||||
if (what >= 101 && what <= (100 + PlayerColor::PLAYER_LIMIT_I))
|
if (what >= 101 && what <= (100 + PlayerColor::PLAYER_LIMIT_I))
|
||||||
|
@ -154,6 +154,8 @@ public:
|
|||||||
static std::map <PlayerColor, std::set <ui8> > playerKeyMap; //[players][keysowned]
|
static std::map <PlayerColor, std::set <ui8> > playerKeyMap; //[players][keysowned]
|
||||||
//SubID 0 - lightblue, 1 - green, 2 - red, 3 - darkblue, 4 - brown, 5 - purple, 6 - white, 7 - black
|
//SubID 0 - lightblue, 1 - green, 2 - red, 3 - darkblue, 4 - brown, 5 - purple, 6 - white, 7 - black
|
||||||
|
|
||||||
|
static void reset();
|
||||||
|
|
||||||
bool wasMyColorVisited (PlayerColor player) const;
|
bool wasMyColorVisited (PlayerColor player) const;
|
||||||
|
|
||||||
std::string getObjectName() const override; //depending on color
|
std::string getObjectName() const override; //depending on color
|
||||||
|
@ -1869,6 +1869,11 @@ void CGGarrison::serializeJsonOptions(JsonSerializeFormat& handler)
|
|||||||
CCreatureSet::serializeJson(handler, "army");
|
CCreatureSet::serializeJson(handler, "army");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGMagi::reset()
|
||||||
|
{
|
||||||
|
eyelist.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CGMagi::initObj()
|
void CGMagi::initObj()
|
||||||
{
|
{
|
||||||
if (ID == Obj::EYE_OF_MAGI)
|
if (ID == Obj::EYE_OF_MAGI)
|
||||||
|
@ -441,6 +441,8 @@ class DLL_LINKAGE CGMagi : public CGObjectInstance
|
|||||||
public:
|
public:
|
||||||
static std::map <si32, std::vector<ObjectInstanceID> > eyelist; //[subID][id], supports multiple sets as in H5
|
static std::map <si32, std::vector<ObjectInstanceID> > eyelist; //[subID][id], supports multiple sets as in H5
|
||||||
|
|
||||||
|
static void reset();
|
||||||
|
|
||||||
void initObj() override;
|
void initObj() override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user