Core/Misc: Rename AreaTriggerStruct to AreaTriggerTeleport

Port From (https://github.com/TrinityCore/TrinityCore/commit/d5b07faca1bb36bd7c836f3f280530f9b26834b1)
This commit is contained in:
Hondacrx
2025-12-08 14:08:14 -05:00
parent bb9d8b50fc
commit 1047cd825d
5 changed files with 24 additions and 24 deletions
+2 -2
View File
@@ -249,7 +249,7 @@ namespace Game.Chat.Commands
player.SaveRecallPosition();
// try going to entrance
AreaTriggerStruct exit = Global.ObjectMgr.GetGoBackTrigger(mapId);
AreaTriggerTeleport exit = Global.ObjectMgr.GetGoBackTrigger(mapId);
if (exit != null)
{
if (player.TeleportTo(exit.target_mapId, exit.target_X, exit.target_Y, exit.target_Z, exit.target_Orientation + MathF.PI))
@@ -268,7 +268,7 @@ namespace Game.Chat.Commands
handler.SendSysMessage(CypherStrings.CommandInstanceNoExit, mapName, mapId);
// try going to start
AreaTriggerStruct entrance = Global.ObjectMgr.GetMapEntranceTrigger(mapId);
AreaTriggerTeleport entrance = Global.ObjectMgr.GetMapEntranceTrigger(mapId);
if (entrance != null)
{
if (player.TeleportTo(entrance.target_mapId, entrance.target_X, entrance.target_Y, entrance.target_Z, entrance.target_Orientation))
+1 -1
View File
@@ -216,7 +216,7 @@ namespace Game.DungeonFinding
// No teleport coords in database, load from areatriggers
if (dungeon.type != LfgType.Random && dungeon.x == 0.0f && dungeon.y == 0.0f && dungeon.z == 0.0f)
{
AreaTriggerStruct at = Global.ObjectMgr.GetMapEntranceTrigger(dungeon.map);
AreaTriggerTeleport at = Global.ObjectMgr.GetMapEntranceTrigger(dungeon.map);
if (at == null)
{
Log.outError(LogFilter.Lfg, "LoadLFGDungeons: Failed to load dungeon {0} (Id: {1}), cant find areatrigger for map {2}", dungeon.name, dungeon.id, dungeon.map);
+1 -1
View File
@@ -3390,7 +3390,7 @@ namespace Game.Entities
if (map == null)
map = Global.MapMgr.CreateMap(mapId, this);
AreaTriggerStruct areaTrigger = null;
AreaTriggerTeleport areaTrigger = null;
bool check = false;
if (map == null)
+19 -19
View File
@@ -5464,17 +5464,24 @@ namespace Game
{
++count;
uint Trigger_ID = result.Read<uint>(0);
uint PortLocID = result.Read<uint>(1);
uint triggerId = result.Read<uint>(0);
uint portLocId = result.Read<uint>(1);
WorldSafeLocsEntry portLoc = GetWorldSafeLoc(PortLocID);
if (portLoc == null)
var atEntry = CliDB.AreaTriggerStorage.LookupByKey(triggerId);
if (atEntry == null)
{
Log.outError(LogFilter.Sql, "Area Trigger (ID: {0}) has a non-existing Port Loc (ID: {1}) in WorldSafeLocs.dbc, skipped", Trigger_ID, PortLocID);
Log.outError(LogFilter.Sql, $"Area Trigger (ID: {triggerId}) does not exist in AreaTrigger.dbc.");
continue;
}
AreaTriggerStruct at = new();
WorldSafeLocsEntry portLoc = GetWorldSafeLoc(portLocId);
if (portLoc == null)
{
Log.outError(LogFilter.Sql, "Area Trigger (ID: {0}) has a non-existing Port Loc (ID: {1}) in WorldSafeLocs.dbc, skipped", triggerId, portLocId);
continue;
}
AreaTriggerTeleport at = new();
at.target_mapId = portLoc.Loc.GetMapId();
at.target_X = portLoc.Loc.GetPositionX();
at.target_Y = portLoc.Loc.GetPositionY();
@@ -5482,14 +5489,7 @@ namespace Game
at.target_Orientation = portLoc.Loc.GetOrientation();
at.PortLocId = portLoc.Id;
AreaTriggerRecord atEntry = CliDB.AreaTriggerStorage.LookupByKey(Trigger_ID);
if (atEntry == null)
{
Log.outError(LogFilter.Sql, "Area trigger (ID: {0}) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
_areaTriggerStorage[Trigger_ID] = at;
_areaTriggerStorage[triggerId] = at;
} while (result.NextRow());
@@ -11277,7 +11277,7 @@ namespace Game
return mountModel.CreatureDisplayID;
}
public AreaTriggerStruct GetAreaTrigger(uint trigger)
public AreaTriggerTeleport GetAreaTrigger(uint trigger)
{
return _areaTriggerStorage.LookupByKey(trigger);
}
@@ -11292,7 +11292,7 @@ namespace Game
return _tavernAreaTriggerStorage.Contains(Trigger_ID);
}
public AreaTriggerStruct GetGoBackTrigger(uint Map)
public AreaTriggerTeleport GetGoBackTrigger(uint Map)
{
uint? parentId = null;
MapRecord mapEntry = CliDB.MapStorage.LookupByKey(Map);
@@ -11319,7 +11319,7 @@ namespace Game
return null;
}
public AreaTriggerStruct GetMapEntranceTrigger(uint Map)
public AreaTriggerTeleport GetMapEntranceTrigger(uint Map)
{
foreach (var pair in _areaTriggerStorage)
{
@@ -11783,7 +11783,7 @@ namespace Game
Dictionary<int, PlayerChoiceLocale> _playerChoiceLocales = new();
List<uint> _tavernAreaTriggerStorage = new();
Dictionary<uint, AreaTriggerStruct> _areaTriggerStorage = new();
Dictionary<uint, AreaTriggerTeleport> _areaTriggerStorage = new();
Dictionary<ulong, AccessRequirement> _accessRequirementStorage = new();
Dictionary<uint, WorldSafeLocsEntry> _worldSafeLocs = new();
@@ -12312,7 +12312,7 @@ namespace Game
}
}
public class AreaTriggerStruct
public class AreaTriggerTeleport
{
public uint target_mapId;
public float target_X;
+1 -1
View File
@@ -288,7 +288,7 @@ namespace Game
if (!packet.Entered)
return;
AreaTriggerStruct at = Global.ObjectMgr.GetAreaTrigger(packet.AreaTriggerID);
AreaTriggerTeleport at = Global.ObjectMgr.GetAreaTrigger(packet.AreaTriggerID);
if (at == null)
return;