Skip to content

Commit

Permalink
fix(Script/WP): correct output of wp show command (#21193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitzunu authored Jan 17, 2025
1 parent 12aa9dc commit cdbc510
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions data/sql/updates/pending_db_world/rev_1737057271097545900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--
UPDATE `acore_string` SET
`content_default` = "No waypoint information was found for Creature (GUID: {}). Make sure 'wp show on' command was properly executed.",
`locale_deDE` = "Keine Wegpunktinformationen wurden für das Wesen (GUID: {}) gefunden. Stellen Sie sicher, dass der Befehl 'wp show on' korrekt ausgeführt wurde.",
`locale_zhCN` = "未找到生物(GUID: {})的路径点信息。请确保正确执行了“wp show on”命令。",
`locale_esES` = "No se encontraron información de punto de ruta para la criatura (GUID: {}). Asegúrese de que el comando 'wp show on' se haya ejecutado correctamente.",
`locale_esMX` = "No se encontraron información de punto de ruta para la criatura (GUID: {}). Asegúrese de que el comando 'wp show on' se haya ejecutado correctamente."
WHERE `entry` = 223;
9 changes: 5 additions & 4 deletions src/server/scripts/Commands/cs_wp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,8 @@ class wp_commandscript : public CommandScript

if (!result)
{
handler->SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM);
return true;
handler->SendErrorMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, target->GetSpawnId());
return false;
}

handler->SendSysMessage("|cff00ffffDEBUG: wp show info:|r");
Expand Down Expand Up @@ -912,15 +912,16 @@ class wp_commandscript : public CommandScript
return false;
}

wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());

// Set "wpguid" column to the visual waypoint
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
stmt->SetData(0, int32(wpCreature->GetSpawnId()));
stmt->SetData(0, wpCreature->GetSpawnId());
stmt->SetData(1, pathid);
stmt->SetData(2, point);

WorldDatabase.Execute(stmt);

wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
if (!wpCreature->LoadCreatureFromDB(wpCreature->GetSpawnId(), map, true, true))
{
Expand Down

0 comments on commit cdbc510

Please sign in to comment.