فهرست منبع

More cleanup:
- moved SoundBase.h to lib since it contains shared data
- added RMG info to object format. Note that data is not yet imported in
configs
- slightly updated API of object handlers

Ivan Savenko 11 سال پیش
والد
کامیت
44742814cd

+ 1 - 1
client/CAdvmapInterface.cpp

@@ -25,7 +25,7 @@
 #include "CPreGame.h"
 #include "CPreGame.h"
 #include "../lib/VCMI_Lib.h"
 #include "../lib/VCMI_Lib.h"
 #include "../lib/CSpellHandler.h"
 #include "../lib/CSpellHandler.h"
-#include "CSoundBase.h"
+#include "../lib/CSoundBase.h"
 #include "../lib/CGameState.h"
 #include "../lib/CGameState.h"
 #include "CMusicHandler.h"
 #include "CMusicHandler.h"
 #include "gui/CGuiHandler.h"
 #include "gui/CGuiHandler.h"

+ 0 - 2
client/CMakeLists.txt

@@ -48,8 +48,6 @@ set(client_SRCS
 )
 )
 
 
 set(client_HEADERS
 set(client_HEADERS
-		CSoundBase.h
-
 		gui/SDL_Pixels.h
 		gui/SDL_Pixels.h
 )
 )
 
 

+ 1 - 1
client/CMusicHandler.h

@@ -1,7 +1,7 @@
 #pragma once
 #pragma once
 
 
 #include "../lib/CConfigHandler.h"
 #include "../lib/CConfigHandler.h"
-#include "CSoundBase.h"
+#include "../lib/CSoundBase.h"
 #include "../lib/CCreatureHandler.h"
 #include "../lib/CCreatureHandler.h"
 
 
 /*
 /*

+ 1 - 1
client/NetPacksClient.cpp

@@ -14,7 +14,7 @@
 #include "../lib/mapping/CMap.h"
 #include "../lib/mapping/CMap.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/CSpellHandler.h"
 #include "../lib/CSpellHandler.h"
-#include "CSoundBase.h"
+#include "../lib/CSoundBase.h"
 #include "mapHandler.h"
 #include "mapHandler.h"
 #include "GUIClasses.h"
 #include "GUIClasses.h"
 #include "../lib/CConfigHandler.h"
 #include "../lib/CConfigHandler.h"

+ 2 - 2
lib/CArtHandler.cpp

@@ -651,7 +651,7 @@ void CArtHandler::afterLoadFinalization()
 
 
 	for (CArtifact * art : artifacts)
 	for (CArtifact * art : artifacts)
 	{
 	{
-		VLC->objtypeh->createObject(art->Name(), JsonNode(), Obj::ARTIFACT, art->id.num);
+		VLC->objtypeh->loadSubObject(art->Name(), JsonNode(), Obj::ARTIFACT, art->id.num);
 
 
 		if (!art->advMapDef.empty())
 		if (!art->advMapDef.empty())
 		{
 		{
@@ -664,7 +664,7 @@ void CArtHandler::afterLoadFinalization()
 		}
 		}
 		// object does not have any templates - this is not usable object (e.g. pseudo-art like lock)
 		// object does not have any templates - this is not usable object (e.g. pseudo-art like lock)
 		if (VLC->objtypeh->getHandlerFor(Obj::ARTIFACT, art->id)->getTemplates().empty())
 		if (VLC->objtypeh->getHandlerFor(Obj::ARTIFACT, art->id)->getTemplates().empty())
-			VLC->objtypeh->eraseObject(Obj::ARTIFACT, art->id);
+			VLC->objtypeh->removeSubObject(Obj::ARTIFACT, art->id);
 	}
 	}
 }
 }
 
 

+ 2 - 2
lib/CCreatureHandler.cpp

@@ -1118,7 +1118,7 @@ void CCreatureHandler::afterLoadFinalization()
 {
 {
 	for (CCreature * crea : creatures)
 	for (CCreature * crea : creatures)
 	{
 	{
-		VLC->objtypeh->createObject(crea->nameSing, JsonNode(), Obj::MONSTER, crea->idNumber.num);
+		VLC->objtypeh->loadSubObject(crea->nameSing, JsonNode(), Obj::MONSTER, crea->idNumber.num);
 		if (!crea->advMapDef.empty())
 		if (!crea->advMapDef.empty())
 		{
 		{
 			JsonNode templ;
 			JsonNode templ;
@@ -1128,7 +1128,7 @@ void CCreatureHandler::afterLoadFinalization()
 
 
 		// object does not have any templates - this is not usable object (e.g. pseudo-creature like Arrow Tower)
 		// object does not have any templates - this is not usable object (e.g. pseudo-creature like Arrow Tower)
 		if (VLC->objtypeh->getHandlerFor(Obj::MONSTER, crea->idNumber.num)->getTemplates().empty())
 		if (VLC->objtypeh->getHandlerFor(Obj::MONSTER, crea->idNumber.num)->getTemplates().empty())
-			VLC->objtypeh->eraseObject(Obj::MONSTER, crea->idNumber.num);
+			VLC->objtypeh->removeSubObject(Obj::MONSTER, crea->idNumber.num);
 	}
 	}
 }
 }
 
 

+ 1 - 1
lib/CHeroHandler.cpp

@@ -235,7 +235,7 @@ void CHeroClassHandler::afterLoadFinalization()
 
 
 	for (CHeroClass * hc : heroClasses)
 	for (CHeroClass * hc : heroClasses)
 	{
 	{
-		VLC->objtypeh->createObject(hc->identifier, JsonNode(), Obj::HERO, hc->id);
+		VLC->objtypeh->loadSubObject(hc->identifier, JsonNode(), Obj::HERO, hc->id);
 		if (!hc->imageMapMale.empty())
 		if (!hc->imageMapMale.empty())
 		{
 		{
 			JsonNode templ;
 			JsonNode templ;

+ 1 - 0
lib/CMakeLists.txt

@@ -104,6 +104,7 @@ set(lib_HEADERS
 
 
 		mapObjects/MapObjects.h
 		mapObjects/MapObjects.h
 
 
+		CSoundBase.h
 		AI_Base.h
 		AI_Base.h
 		CondSh.h
 		CondSh.h
 		ConstTransitivePtr.h
 		ConstTransitivePtr.h

+ 0 - 0
client/CSoundBase.h → lib/CSoundBase.h


+ 2 - 2
lib/CTownHandler.cpp

@@ -763,7 +763,7 @@ void CTownHandler::afterLoadFinalization()
 	{
 	{
 		if (fact->town)
 		if (fact->town)
 		{
 		{
-			VLC->objtypeh->createObject(fact->identifier, JsonNode(), Obj::TOWN, fact->index);
+			VLC->objtypeh->loadSubObject(fact->identifier, JsonNode(), Obj::TOWN, fact->index);
 			if (!fact->town->clientInfo.advMapCastle.empty())
 			if (!fact->town->clientInfo.advMapCastle.empty())
 			{
 			{
 				JsonNode templ;
 				JsonNode templ;
@@ -782,7 +782,7 @@ void CTownHandler::afterLoadFinalization()
 						JsonNode templ;
 						JsonNode templ;
 						templ["animation"].String() = fact->town->dwellings[i];
 						templ["animation"].String() = fact->town->dwellings[i];
 
 
-						VLC->objtypeh->createObject("", JsonNode(), Obj::CREATURE_GENERATOR1, 80 + cre);
+						VLC->objtypeh->loadSubObject("", JsonNode(), Obj::CREATURE_GENERATOR1, 80 + cre);
 						VLC->objtypeh->getHandlerFor(Obj::CREATURE_GENERATOR1, 80 + cre)->addTemplate(templ);
 						VLC->objtypeh->getHandlerFor(Obj::CREATURE_GENERATOR1, 80 + cre)->addTemplate(templ);
 						VLC->objh->cregens[80 + cre] = cre; //map of dwelling -> creature id
 						VLC->objh->cregens[80 + cre] = cre; //map of dwelling -> creature id
 					}
 					}

+ 8 - 13
lib/JsonNode.h

@@ -108,19 +108,14 @@ public:
 	template <typename Handler> void serialize(Handler &h, const int version)
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
 	{
 		h & meta;
 		h & meta;
-		// simple saving - save json in its string interpretation
-		if (h.saving)
-		{
-			std::ostringstream stream;
-			stream << *this;
-			std::string str = stream.str();
-			h & str;
-		}
-		else
-		{
-			std::string str;
-			h & str;
-			JsonNode(str.c_str(), str.size()).swap(*this);
+		h & type;
+		switch (type) {
+			break; case DATA_NULL:
+			break; case DATA_BOOL:   h & data.Bool;
+			break; case DATA_FLOAT:  h & data.Float;
+			break; case DATA_STRING: h & data.String;
+			break; case DATA_VECTOR: h & data.Vector;
+			break; case DATA_STRUCT: h & data.Struct;
 		}
 		}
 	}
 	}
 };
 };

+ 1 - 1
lib/mapObjects/CBank.cpp

@@ -13,7 +13,7 @@
 
 
 #include "../NetPacks.h"
 #include "../NetPacks.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 
 
 using namespace boost::assign;
 using namespace boost::assign;
 
 

+ 1 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -14,7 +14,7 @@
 #include "../NetPacks.h"
 #include "../NetPacks.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
 #include "../CHeroHandler.h"
 #include "../CHeroHandler.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 #include "../CSpellHandler.h"
 #include "../CSpellHandler.h"
 #include "CObjectClassesHandler.h"
 #include "CObjectClassesHandler.h"
 
 

+ 1 - 1
lib/mapObjects/CGPandoraBox.cpp

@@ -12,7 +12,7 @@
 #include "CGPandoraBox.h"
 #include "CGPandoraBox.h"
 
 
 #include "../NetPacks.h"
 #include "../NetPacks.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 
 
 #include "../CSpellHandler.h"
 #include "../CSpellHandler.h"
 
 

+ 47 - 4
lib/mapObjects/CObjectClassesHandler.cpp

@@ -185,7 +185,7 @@ void CObjectClassesHandler::loadObject(std::string scope, std::string name, cons
 	VLC->modh->identifiers.registerObject(scope, "object", name, object->id);
 	VLC->modh->identifiers.registerObject(scope, "object", name, object->id);
 }
 }
 
 
-void CObjectClassesHandler::createObject(std::string name, JsonNode config, si32 ID, boost::optional<si32> subID)
+void CObjectClassesHandler::loadSubObject(std::string name, JsonNode config, si32 ID, boost::optional<si32> subID)
 {
 {
 	config.setType(JsonNode::DATA_STRUCT); // ensure that input is not NULL
 	config.setType(JsonNode::DATA_STRUCT); // ensure that input is not NULL
 	assert(objects.count(ID));
 	assert(objects.count(ID));
@@ -201,7 +201,7 @@ void CObjectClassesHandler::createObject(std::string name, JsonNode config, si32
 	loadObjectEntry(config, objects[ID]);
 	loadObjectEntry(config, objects[ID]);
 }
 }
 
 
-void CObjectClassesHandler::eraseObject(si32 ID, si32 subID)
+void CObjectClassesHandler::removeSubObject(si32 ID, si32 subID)
 {
 {
 	assert(objects.count(ID));
 	assert(objects.count(ID));
 	assert(objects.at(ID)->objects.count(subID));
 	assert(objects.at(ID)->objects.count(subID));
@@ -225,6 +225,28 @@ TObjectTypeHandler CObjectClassesHandler::getHandlerFor(si32 type, si32 subtype)
 	return nullptr;
 	return nullptr;
 }
 }
 
 
+std::set<si32> CObjectClassesHandler::knownObjects() const
+{
+	std::set<si32> ret;
+
+	for (auto entry : objects)
+		ret.insert(entry.first);
+
+	return ret;
+}
+
+std::set<si32> CObjectClassesHandler::knownSubObjects(si32 primaryID) const
+{
+	std::set<si32> ret;
+
+	if (objects.count(primaryID))
+	{
+		for (auto entry : objects.at(primaryID)->objects)
+			ret.insert(entry.first);
+	}
+	return ret;
+}
+
 void CObjectClassesHandler::beforeValidate(JsonNode & object)
 void CObjectClassesHandler::beforeValidate(JsonNode & object)
 {
 {
 	for (auto & entry : object["types"].Struct())
 	for (auto & entry : object["types"].Struct())
@@ -239,7 +261,6 @@ void CObjectClassesHandler::beforeValidate(JsonNode & object)
 
 
 void CObjectClassesHandler::afterLoadFinalization()
 void CObjectClassesHandler::afterLoadFinalization()
 {
 {
-	legacyTemplates.clear(); // whatever left there is no longer needed
 	for (auto entry : objects)
 	for (auto entry : objects)
 	{
 	{
 		for (auto obj : entry.second->objects)
 		for (auto obj : entry.second->objects)
@@ -262,9 +283,26 @@ void AObjectTypeHandler::setType(si32 type, si32 subtype)
 	this->subtype = subtype;
 	this->subtype = subtype;
 }
 }
 
 
+static ui32 loadJsonOrMax(const JsonNode & input)
+{
+	if (input.isNull())
+		return std::numeric_limits<ui32>::max();
+	else
+		return input.Float();
+}
+
 void AObjectTypeHandler::init(const JsonNode & input)
 void AObjectTypeHandler::init(const JsonNode & input)
 {
 {
 	base = input["base"];
 	base = input["base"];
+
+	if (!input["rmg"].isNull())
+	{
+		rmgInfo.value =     input["rmg"]["value"].Float();
+		rmgInfo.mapLimit =  loadJsonOrMax(input["rmg"]["mapLimit"]);
+		rmgInfo.zoneLimit = loadJsonOrMax(input["rmg"]["zoneLimit"]);
+		rmgInfo.rarity =    input["rmg"]["rarity"].Float();
+	} // else block is not needed - set in constructor
+
 	for (auto entry : input["templates"].Struct())
 	for (auto entry : input["templates"].Struct())
 	{
 	{
 		entry.second.setType(JsonNode::DATA_STRUCT);
 		entry.second.setType(JsonNode::DATA_STRUCT);
@@ -281,7 +319,7 @@ void AObjectTypeHandler::init(const JsonNode & input)
 
 
 bool AObjectTypeHandler::objectFilter(const CGObjectInstance *, const ObjectTemplate &) const
 bool AObjectTypeHandler::objectFilter(const CGObjectInstance *, const ObjectTemplate &) const
 {
 {
-	return true; // by default - accept all.
+	return false; // by default there are no overrides
 }
 }
 
 
 void AObjectTypeHandler::addTemplate(ObjectTemplate templ)
 void AObjectTypeHandler::addTemplate(ObjectTemplate templ)
@@ -331,3 +369,8 @@ boost::optional<ObjectTemplate> AObjectTypeHandler::getOverride(si32 terrainType
 	}
 	}
 	return boost::optional<ObjectTemplate>();
 	return boost::optional<ObjectTemplate>();
 }
 }
+
+const RandomMapInfo & AObjectTypeHandler::getRMGInfo()
+{
+	return rmgInfo;
+}

+ 44 - 10
lib/mapObjects/CObjectClassesHandler.h

@@ -19,6 +19,34 @@
 class JsonNode;
 class JsonNode;
 class CRandomGenerator;
 class CRandomGenerator;
 
 
+/// Structure that describes placement rules for this object in random map
+struct RandomMapInfo
+{
+	/// How valuable this object is, 1k = worthless, 10k = Utopia-level
+	ui32 value;
+
+	/// How many of such objects can be placed on map, 0 = object can not be placed by RMG
+	ui32 mapLimit;
+
+	/// How many of such objects can be placed in one zone, 0 = unplaceable
+	ui32 zoneLimit;
+
+	/// Rarity of object, 5 = extremely rare, 100 = common
+	ui32 rarity;
+
+	RandomMapInfo():
+		value(0),
+		mapLimit(0),
+		zoneLimit(0),
+		rarity(0)
+	{}
+
+	template <typename Handler> void serialize(Handler &h, const int version)
+	{
+		h & value & mapLimit & zoneLimit & rarity;
+	}
+};
+
 class IObjectInfo
 class IObjectInfo
 {
 {
 public:
 public:
@@ -42,6 +70,8 @@ class CGObjectInstance;
 
 
 class AObjectTypeHandler
 class AObjectTypeHandler
 {
 {
+	RandomMapInfo rmgInfo;
+
 	si32 type;
 	si32 type;
 	si32 subtype;
 	si32 subtype;
 
 
@@ -56,22 +86,22 @@ public:
 
 
 	void setType(si32 type, si32 subtype);
 	void setType(si32 type, si32 subtype);
 
 
-	/// loads templates from Json structure using fields "base" and "templates"
+	/// loads generic data from Json structure
 	virtual void init(const JsonNode & input);
 	virtual void init(const JsonNode & input);
 
 
 	void addTemplate(ObjectTemplate templ);
 	void addTemplate(ObjectTemplate templ);
 	void addTemplate(JsonNode config);
 	void addTemplate(JsonNode config);
 
 
-	/// returns all templates, without any filters
+	/// returns all templates matching parameters
 	std::vector<ObjectTemplate> getTemplates() const;
 	std::vector<ObjectTemplate> getTemplates() const;
-
-	/// returns all templates that can be placed on specific terrain type
 	std::vector<ObjectTemplate> getTemplates(si32 terrainType) const;
 	std::vector<ObjectTemplate> getTemplates(si32 terrainType) const;
 
 
 	/// returns preferred template for this object, if present (e.g. one of 3 possible templates for town - village, fort and castle)
 	/// returns preferred template for this object, if present (e.g. one of 3 possible templates for town - village, fort and castle)
 	/// note that appearance will not be changed - this must be done separately (either by assignment or via pack from server)
 	/// note that appearance will not be changed - this must be done separately (either by assignment or via pack from server)
 	boost::optional<ObjectTemplate> getOverride(si32 terrainType, const CGObjectInstance * object) const;
 	boost::optional<ObjectTemplate> getOverride(si32 terrainType, const CGObjectInstance * object) const;
 
 
+	const RandomMapInfo & getRMGInfo();
+
 	/// Creates object and set up core properties (like ID/subID). Object is NOT initialized
 	/// Creates object and set up core properties (like ID/subID). Object is NOT initialized
 	/// to allow creating objects before game start (e.g. map loading)
 	/// to allow creating objects before game start (e.g. map loading)
 	virtual CGObjectInstance * create(ObjectTemplate tmpl) const = 0;
 	virtual CGObjectInstance * create(ObjectTemplate tmpl) const = 0;
@@ -84,7 +114,7 @@ public:
 
 
 	template <typename Handler> void serialize(Handler &h, const int version)
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
 	{
-		h & type & subtype & templates;
+		h & type & subtype & templates & rmgInfo;
 	}
 	}
 };
 };
 
 
@@ -129,7 +159,7 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase
 
 
 		template <typename Handler> void serialize(Handler &h, const int version)
 		template <typename Handler> void serialize(Handler &h, const int version)
 		{
 		{
-			h & base & objects;
+			h & name & handlerName & base & objects;
 		}
 		}
 	};
 	};
 
 
@@ -138,10 +168,10 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase
 	/// list of object handlers, each of them handles only one type
 	/// list of object handlers, each of them handles only one type
 	std::map<si32, ObjectContainter * > objects;
 	std::map<si32, ObjectContainter * > objects;
 
 
-	/// map that is filled during contruction with all known handlers. Not serializeable
+	/// map that is filled during contruction with all known handlers. Not serializeable due to usage of std::function
 	std::map<std::string, std::function<TObjectTypeHandler()> > handlerConstructors;
 	std::map<std::string, std::function<TObjectTypeHandler()> > handlerConstructors;
 
 
-	/// container with H3 templates, used only during loading
+	/// container with H3 templates, used only during loading, no need to serialize it
 	TTemplatesContainer legacyTemplates;
 	TTemplatesContainer legacyTemplates;
 
 
 	void loadObjectEntry(const JsonNode & entry, ObjectContainter * obj);
 	void loadObjectEntry(const JsonNode & entry, ObjectContainter * obj);
@@ -154,14 +184,18 @@ public:
 	void loadObject(std::string scope, std::string name, const JsonNode & data) override;
 	void loadObject(std::string scope, std::string name, const JsonNode & data) override;
 	void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
 	void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
 
 
-	void createObject(std::string name, JsonNode config, si32 ID, boost::optional<si32> subID = boost::optional<si32>());
-	void eraseObject(si32 ID, si32 subID);
+	void loadSubObject(std::string name, JsonNode config, si32 ID, boost::optional<si32> subID = boost::optional<si32>());
+	void removeSubObject(si32 ID, si32 subID);
 
 
 	void beforeValidate(JsonNode & object) override;
 	void beforeValidate(JsonNode & object) override;
 	void afterLoadFinalization() override;
 	void afterLoadFinalization() override;
 
 
 	std::vector<bool> getDefaultAllowed() const override;
 	std::vector<bool> getDefaultAllowed() const override;
 
 
+	/// Queries to detect loaded objects
+	std::set<si32> knownObjects() const;
+	std::set<si32> knownSubObjects(si32 primaryID) const;
+
 	/// returns handler for specified object (ID-based). ObjectHandler keeps ownership
 	/// returns handler for specified object (ID-based). ObjectHandler keeps ownership
 	TObjectTypeHandler getHandlerFor(si32 type, si32 subtype) const;
 	TObjectTypeHandler getHandlerFor(si32 type, si32 subtype) const;
 
 

+ 1 - 1
lib/mapObjects/CObjectHandler.cpp

@@ -14,7 +14,7 @@
 #include "../NetPacks.h"
 #include "../NetPacks.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
 #include "../CHeroHandler.h"
 #include "../CHeroHandler.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 
 
 #include "CObjectClassesHandler.h"
 #include "CObjectClassesHandler.h"
 
 

+ 1 - 1
lib/mapObjects/CQuest.cpp

@@ -13,7 +13,7 @@
 #include "CQuest.h"
 #include "CQuest.h"
 
 
 #include "../NetPacks.h"
 #include "../NetPacks.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
 #include "../CHeroHandler.h"
 #include "../CHeroHandler.h"
 #include "CObjectClassesHandler.h"
 #include "CObjectClassesHandler.h"

+ 1 - 1
lib/mapObjects/CRewardableObject.cpp

@@ -13,7 +13,7 @@
 #include "CRewardableObject.h"
 #include "CRewardableObject.h"
 #include "../CHeroHandler.h"
 #include "../CHeroHandler.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 #include "../NetPacks.h"
 #include "../NetPacks.h"
 
 
 #include "CObjectClassesHandler.h"
 #include "CObjectClassesHandler.h"

+ 1 - 1
lib/mapObjects/MiscObjects.cpp

@@ -13,7 +13,7 @@
 
 
 #include "../NetPacks.h"
 #include "../NetPacks.h"
 #include "../CGeneralTextHandler.h"
 #include "../CGeneralTextHandler.h"
-#include "../client/CSoundBase.h"
+#include "../CSoundBase.h"
 
 
 #include "CObjectClassesHandler.h"
 #include "CObjectClassesHandler.h"
 #include "../CSpellHandler.h"
 #include "../CSpellHandler.h"

+ 1 - 1
server/CGameHandler.cpp

@@ -21,7 +21,7 @@
 #include "../lib/mapping/CMap.h"
 #include "../lib/mapping/CMap.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/ScopeGuard.h"
 #include "../lib/ScopeGuard.h"
-#include "../client/CSoundBase.h"
+#include "../lib/CSoundBase.h"
 #include "CGameHandler.h"
 #include "CGameHandler.h"
 #include "CVCMIServer.h"
 #include "CVCMIServer.h"
 #include "../lib/CCreatureSet.h"
 #include "../lib/CCreatureSet.h"