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