From 88356bb5078a756b2471562d6ad4e18006014133 Mon Sep 17 00:00:00 2001 From: SaW Date: Fri, 14 Mar 2025 08:40:55 +0100 Subject: [PATCH] Prevent crash on update SQL (#1076) Delete entries before adding to avoid duplicates. --- .../updates/db_playerbots/2025_03_03_00.sql | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/data/sql/playerbots/updates/db_playerbots/2025_03_03_00.sql b/data/sql/playerbots/updates/db_playerbots/2025_03_03_00.sql index cc1f4f0e..29d8afb4 100644 --- a/data/sql/playerbots/updates/db_playerbots/2025_03_03_00.sql +++ b/data/sql/playerbots/updates/db_playerbots/2025_03_03_00.sql @@ -1,12 +1,22 @@ -INSERT INTO `playerbots_travelnode` (`id`, `name`, `map_id`, `x`, `y`, `z`, `linked`) VALUES -(3780, 'Highlord Mograine', 533, 2524.32, -2951.28, 245.633, 1); +-- Delete existing entries from playerbots_travelnode, playerbots_travelnode_path, and playerbots_travelnode_link tables +DELETE FROM `playerbots_travelnode_link` WHERE `node_id` = 3780; +DELETE FROM `playerbots_travelnode_path` WHERE `node_id` = 3780; +DELETE FROM `playerbots_travelnode` WHERE `id` = 3780; -INSERT INTO `playerbots_travelnode_path` (`node_id`, `to_node_id`, `nr`, `map_id`, `x`, `y`, `z`) VALUES +-- Insert new entries into playerbots_travelnode +INSERT INTO `playerbots_travelnode` (`id`, `name`, `map_id`, `x`, `y`, `z`, `linked`) +VALUES (3780, 'Highlord Mograine', 533, 2524.32, -2951.28, 245.633, 1); + +-- Insert new entries into playerbots_travelnode_path +INSERT INTO `playerbots_travelnode_path` (`node_id`, `to_node_id`, `nr`, `map_id`, `x`, `y`, `z`) +VALUES (3780, 472, 0, 533, 2524.32, -2951.28, 245.633), (3780, 472, 1, 533, 2528.79, -2948.58, 245.633), (3780, 757, 0, 533, 2524.32, -2951.28, 245.633), (3780, 757, 1, 533, 2517.62, -2959.38, 245.636); -INSERT INTO `playerbots_travelnode_link` (`node_id`, `to_node_id`, `type`, `object`, `distance`, `swim_distance`, `extra_cost`, `calculated`, `max_creature_0`, `max_creature_1`, `max_creature_2`) VALUES +-- Insert new entries into playerbots_travelnode_link +INSERT INTO `playerbots_travelnode_link` (`node_id`, `to_node_id`, `type`, `object`, `distance`, `swim_distance`, `extra_cost`, `calculated`, `max_creature_0`, `max_creature_1`, `max_creature_2`) +VALUES (3780, 472, 1, 0, 5.3221, 0, 0, 1, 83, 0, 0), (3780, 757, 1, 0, 10.6118, 0, 0, 1, 83, 0, 0);