From 3f9e53acc85682f282984adeb671d6035ce12bf1 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Thu, 30 May 2024 21:57:58 +0200 Subject: [PATCH 1/2] fix typo --- lib/constants/Enumerations.h | 2 +- lib/mapObjects/IMarket.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/constants/Enumerations.h b/lib/constants/Enumerations.h index ef8cd894e..6e86f6bfb 100644 --- a/lib/constants/Enumerations.h +++ b/lib/constants/Enumerations.h @@ -59,7 +59,7 @@ enum class EMarketMode : int8_t { RESOURCE_RESOURCE, RESOURCE_PLAYER, CREATURE_RESOURCE, RESOURCE_ARTIFACT, ARTIFACT_RESOURCE, ARTIFACT_EXP, CREATURE_EXP, CREATURE_UNDEAD, RESOURCE_SKILL, - MARTKET_AFTER_LAST_PLACEHOLDER + MARKET_AFTER_LAST_PLACEHOLDER }; enum class EAiTactic : int8_t diff --git a/lib/mapObjects/IMarket.cpp b/lib/mapObjects/IMarket.cpp index 06fb94f1e..7f7840408 100644 --- a/lib/mapObjects/IMarket.cpp +++ b/lib/mapObjects/IMarket.cpp @@ -161,7 +161,7 @@ IMarket::IMarket() std::vector IMarket::availableModes() const { std::vector ret; - for (EMarketMode i = static_cast(0); i < EMarketMode::MARTKET_AFTER_LAST_PLACEHOLDER; i = vstd::next(i, 1)) + for (EMarketMode i = static_cast(0); i < EMarketMode::MARKET_AFTER_LAST_PLACEHOLDER; i = vstd::next(i, 1)) if(allowsTrade(i)) ret.push_back(i); From 9c1ce214fcfe760ec1a80a3ab9f6ab02876fc5f7 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Thu, 30 May 2024 21:58:35 +0200 Subject: [PATCH 2/2] thievesGuild support --- client/windows/CCastleInterface.cpp | 5 +++++ lib/CGameInfoCallback.cpp | 6 ++++-- lib/constants/Enumerations.h | 1 + lib/constants/StringConstants.h | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 025db7140..eb90d6a0e 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -744,6 +744,7 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil case BuildingID::SPECIAL_1: case BuildingID::SPECIAL_2: case BuildingID::SPECIAL_3: + case BuildingID::SPECIAL_4: switch (subID) { case BuildingSubID::NONE: @@ -808,6 +809,10 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil enterBlacksmith(ArtifactID::BALLISTA); break; + case BuildingSubID::THIEVES_GUILD: + enterAnyThievesGuild(); + break; + default: enterBuilding(building); break; diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index 4385fad42..d58f6dafe 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -224,15 +224,17 @@ void CGameInfoCallback::getThievesGuildInfo(SThievesGuildInfo & thi, const CGObj ERROR_RET_IF(obj->ID == Obj::TOWN && !canGetFullInfo(obj), "Cannot get info about town guild object!"); //TODO: advmap object -> check if they're visited by our hero - if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN) + if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN) { int taverns = 0; for(auto town : gs->players[*getPlayerID()].towns) { if(town->hasBuilt(BuildingID::TAVERN)) taverns++; + + if(town->hasBuilt(BuildingSubID::THIEVES_GUILD)) + taverns += 2; } - gs->obtainPlayersStats(thi, taverns); } else if(obj->ID == Obj::DEN_OF_THIEVES) diff --git a/lib/constants/Enumerations.h b/lib/constants/Enumerations.h index 6e86f6bfb..db3b6320d 100644 --- a/lib/constants/Enumerations.h +++ b/lib/constants/Enumerations.h @@ -50,6 +50,7 @@ namespace BuildingSubID EXPERIENCE_VISITING_BONUS, LIGHTHOUSE, TREASURY, + THIEVES_GUILD, CUSTOM_VISITING_BONUS, CUSTOM_VISITING_REWARD }; diff --git a/lib/constants/StringConstants.h b/lib/constants/StringConstants.h index d7b40fd92..c017ef659 100644 --- a/lib/constants/StringConstants.h +++ b/lib/constants/StringConstants.h @@ -198,7 +198,8 @@ namespace MappedKeys { "knowledgeVisitingBonus", BuildingSubID::KNOWLEDGE_VISITING_BONUS }, { "experienceVisitingBonus", BuildingSubID::EXPERIENCE_VISITING_BONUS }, { "lighthouse", BuildingSubID::LIGHTHOUSE }, - { "treasury", BuildingSubID::TREASURY } + { "treasury", BuildingSubID::TREASURY }, + { "thievesGuild", BuildingSubID::THIEVES_GUILD } }; static const std::map MARKET_NAMES_TO_TYPES =