mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 08:59:11 +01:00
Core/Movement: updated smartAI waypoint support to use the new smooth transition field as well
This commit is contained in:
8
sql/updates/world/4.3.4/2021_07_16_00_world.sql
Normal file
8
sql/updates/world/4.3.4/2021_07_16_00_world.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE `waypoints`
|
||||
ADD COLUMN `smoothTransition` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `delay`;
|
||||
|
||||
UPDATE `waypoints` SET `smoothTransition`= 1 WHERE `delay` < 0;
|
||||
UPDATE `waypoints` SET `delay`= 0 WHERE `delay` < 0;
|
||||
|
||||
ALTER TABLE `waypoints`
|
||||
MODIFY COLUMN `delay` int UNSIGNED NOT NULL DEFAULT 0 AFTER `velocity`;
|
||||
@@ -27,7 +27,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, SoundType, 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, event_param5, 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, orientation, velocity, delay FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z, orientation, velocity, delay, smoothTransition FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO graveyard_zone (ID, GhostZone, Faction) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
|
||||
@@ -74,7 +74,8 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
o = fields[5].GetFloat();
|
||||
|
||||
float velocity = fields[6].GetFloat();
|
||||
int32 delay = fields[7].GetInt32();
|
||||
uint32 delay = fields[7].GetUInt32();
|
||||
bool smoothTransition = fields[8].GetBool();
|
||||
|
||||
if (lastEntry != entry)
|
||||
{
|
||||
@@ -89,7 +90,7 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
|
||||
WaypointPath& path = _waypointStore[entry];
|
||||
path.Id = entry;
|
||||
path.Nodes.emplace_back(id, x, y, z, o, velocity, delay);
|
||||
path.Nodes.emplace_back(id, x, y, z, o, velocity, delay, smoothTransition);
|
||||
|
||||
lastEntry = entry;
|
||||
++total;
|
||||
|
||||
Reference in New Issue
Block a user