Core/Movement: updated smartAI waypoint support to use the new smooth transition field as well

This commit is contained in:
Ovahlord
2021-07-16 16:56:35 +02:00
parent 64a2487457
commit b236bd39df
3 changed files with 12 additions and 3 deletions

View 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`;

View File

@@ -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);

View File

@@ -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;