From 25f2effd85479a758b0770f9ada2b37951d7e928 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 16 Dec 2020 00:20:25 -0500 Subject: [PATCH] Misc cleanups --- Source/Framework/Logging/Appender.cs | 2 +- Source/Game/Globals/ObjectManager.cs | 6 +++--- Source/Game/Spells/SpellManager.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Framework/Logging/Appender.cs b/Source/Framework/Logging/Appender.cs index 5a25ca78d..822bb747e 100644 --- a/Source/Framework/Logging/Appender.cs +++ b/Source/Framework/Logging/Appender.cs @@ -78,7 +78,7 @@ class FileAppender : Appender, IDisposable { lock (locker) { - var logBytes = Encoding.Unicode.GetBytes(message.prefix + message.text + "\r\n"); + var logBytes = Encoding.UTF8.GetBytes(message.prefix + message.text + "\r\n"); if (_dynamicName) { diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index efb21d636..8fd60f571 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -4440,14 +4440,14 @@ namespace Game if (Global.SpellMgr.HasSpellInfo(dataN, Difficulty.None)) return; - Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but Spell (Entry {4}) not exist.", goInfo.entry, goInfo.type, N, dataN, dataN); + Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but Spell (Entry {4}) not exist.", goInfo.entry, goInfo.type, N, dataN, dataN); } void CheckAndFixGOChairHeightId(GameObjectTemplate goInfo, ref uint dataN, uint N) { if (dataN <= (UnitStandStateType.SitHighChair - UnitStandStateType.SitLowChair)) return; - Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but correct chair height in range 0..{4}.", goInfo.entry, goInfo.type, N, dataN, UnitStandStateType.SitHighChair - UnitStandStateType.SitLowChair); + Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but correct chair height in range 0..{4}.", goInfo.entry, goInfo.type, N, dataN, UnitStandStateType.SitHighChair - UnitStandStateType.SitLowChair); // prevent client and server unexpected work dataN = 0; @@ -4466,7 +4466,7 @@ namespace Game if (dataN <= 1) return; - Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but expected boolean (0/1) consumable field value.", + Log.outError(LogFilter.Sql, "Gameobject (Entry: {0} GoType: {1}) have data{2}={3} but expected boolean (0/1) consumable field value.", goInfo.entry, goInfo.type, N, dataN); } diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 965d91a67..70ce9c685 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -2377,7 +2377,7 @@ namespace Game.Entities uint attributes = result.Read(1); var spells = _GetSpellInfo(spellId); - if (spells == null) + if (spells.Empty()) { Log.outError(LogFilter.Sql, "Table `spell_custom_attr` has wrong spell (entry: {0}), ignored.", spellId); continue;