aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-10-02 22:36:58 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-10-02 22:36:58 +0200
commitcaeb933d9e21efb80b36e4b2cc805a2ec02db237 (patch)
treea424f6f23ffa091594a4e6c4967c7858a9931d0c
parent3545d60b7d70e7097e1aeda8b7dd6af19a6c0ab8 (diff)
parentd828d16e9e0a7416823c07d27a19f4362c3f0826 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
-rw-r--r--sql/updates/world/2014_10_02_00_world.sql1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp25
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp1
-rw-r--r--src/server/shared/Threading/ProducerConsumerQueue.h4
4 files changed, 28 insertions, 3 deletions
diff --git a/sql/updates/world/2014_10_02_00_world.sql b/sql/updates/world/2014_10_02_00_world.sql
new file mode 100644
index 00000000000..56b64e95517
--- /dev/null
+++ b/sql/updates/world/2014_10_02_00_world.sql
@@ -0,0 +1 @@
+UPDATE `quest_template` SET `SpecialFlags`=1 WHERE `Id` = 11293;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 6a380476c90..eb36da6fdae 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -235,6 +235,31 @@ void SmartAIMgr::LoadSmartAIFromDB()
}
while (result->NextRow());
+ // TO-DO: Find better way
+ for (uint8 i = 0; i < SMART_SCRIPT_TYPE_MAX; i++)
+ {
+ for (auto itr = mEventMap[i].begin(); itr != mEventMap[i].end(); ++itr)
+ {
+ for (auto e : mEventMap[i][itr->first])
+ {
+ bool found = false;
+ if (e.link && e.link != e.event_id)
+ {
+ for (auto linked : mEventMap[i][itr->first])
+ {
+ if (linked.event_id == e.link)
+ if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK)
+ found = true;
+ }
+
+ if (!found)
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
+ }
+ }
+ }
+ }
+
TC_LOG_INFO("server.loading", ">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
UnLoadHelperStores();
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index 5d8da598299..b2f524f7eb0 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -84,6 +84,7 @@ bool AuctionBotSeller::Initialize()
"SELECT `item` FROM `milling_loot_template` UNION "
"SELECT `item` FROM `pickpocketing_loot_template` UNION "
"SELECT `item` FROM `prospecting_loot_template` UNION "
+ "SELECT `item` FROM `reference_loot_template` UNION "
"SELECT `item` FROM `skinning_loot_template` UNION "
"SELECT `item` FROM `spell_loot_template`");
diff --git a/src/server/shared/Threading/ProducerConsumerQueue.h b/src/server/shared/Threading/ProducerConsumerQueue.h
index a76b8b0b5c0..d0b3631a9dd 100644
--- a/src/server/shared/Threading/ProducerConsumerQueue.h
+++ b/src/server/shared/Threading/ProducerConsumerQueue.h
@@ -82,7 +82,7 @@ public:
void Cancel()
{
- _queueLock.lock();
+ std::unique_lock<std::mutex> lock(_queueLock);
while (!_queue.empty())
{
@@ -95,8 +95,6 @@ public:
_shutdown = true;
- _queueLock.unlock();
-
_condition.notify_all();
}