Core/Player: Log more information when Player::StopCastingCharm() fails

Port From (https://github.com/TrinityCore/TrinityCore/commit/89ea13ed46744414f74686cf2126dc637188180d)
This commit is contained in:
hondacrx
2022-05-26 20:20:18 -04:00
parent 9b6540c91d
commit ba87f08c37
3 changed files with 23 additions and 2 deletions
+21
View File
@@ -24,6 +24,7 @@ using Game.Movement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Game.Entities
{
@@ -559,6 +560,26 @@ namespace Game.Entities
return TimeSpan.FromMilliseconds(1);
}
public string GetDebugInfo()
{
StringBuilder str = new StringBuilder("Vehicle seats:\n");
foreach (var (id, seat) in Seats)
str.Append($"seat {id}: {(seat.IsEmpty() ? "empty" : seat.Passenger.Guid)}\n");
str.Append("Vehicle pending events:");
if (_pendingJoinEvents.Empty())
str.Append(" none");
else
{
str.Append("\n");
foreach (var joinEvent in _pendingJoinEvents)
str.Append($"seat {joinEvent.Seat.Key}: {joinEvent.Passenger.GetGUID()}\n");
}
return str.ToString();
}
public Unit GetBase() { return _me; }
public VehicleRecord GetVehicleInfo() { return _vehicleInfo; }
public uint GetCreatureEntry() { return _creatureEntry; }