aboutsummaryrefslogtreecommitdiff
path: root/src/server/database/Database/Implementation
diff options
context:
space:
mode:
authorkelno <kelno@users.noreply.github.com>2018-01-08 00:32:22 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2018-01-08 00:32:22 +0100
commit70eb18d0e58ecf0cfcda4f410a183c671fbafe5c (patch)
tree0b85cad9a399dd58169018dd6fa6ab328843744d /src/server/database/Database/Implementation
parentf0a394753ad9f1614fd696027c51ed2e297a02f6 (diff)
Core/Creature: improve DB linked_respawn handling (#21172)
* Fixed SetCreatureLinkedRespawn function possible erasing/replacing a GameObject link (instead of a creature one)
Diffstat (limited to 'src/server/database/Database/Implementation')
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.cpp5
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.h5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/server/database/Database/Implementation/WorldDatabase.cpp b/src/server/database/Database/Implementation/WorldDatabase.cpp
index a3ba4efcc18..b286a88e688 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/database/Database/Implementation/WorldDatabase.cpp
@@ -24,8 +24,9 @@ void WorldDatabaseConnection::DoPrepareStatements()
m_stmts.resize(MAX_WORLDDATABASE_STATEMENTS);
PrepareStatement(WORLD_SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH);
- PrepareStatement(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_DEL_LINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ? AND linkType = ?", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_DEL_LINKED_RESPAWN_MASTER, "DELETE FROM linked_respawn WHERE linkedGuid = ? AND linkType = ?", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_REP_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid, linkType) VALUES (?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, BroadcastTextId, TextRange FROM creature_text", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH);
diff --git a/src/server/database/Database/Implementation/WorldDatabase.h b/src/server/database/Database/Implementation/WorldDatabase.h
index bca73bf22d5..b493dab786e 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.h
+++ b/src/server/database/Database/Implementation/WorldDatabase.h
@@ -29,8 +29,9 @@ enum WorldDatabaseStatements : uint32
*/
WORLD_SEL_QUEST_POOLS,
- WORLD_DEL_CRELINKED_RESPAWN,
- WORLD_REP_CREATURE_LINKED_RESPAWN,
+ WORLD_DEL_LINKED_RESPAWN,
+ WORLD_DEL_LINKED_RESPAWN_MASTER,
+ WORLD_REP_LINKED_RESPAWN,
WORLD_SEL_CREATURE_TEXT,
WORLD_SEL_SMART_SCRIPTS,
WORLD_SEL_SMARTAI_WP,