Misc fixes

This commit is contained in:
hondacrx
2022-05-05 10:03:40 -04:00
parent fe56f40eac
commit 8abb8679db
4 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -286,9 +286,9 @@ namespace Game.Achievements
case CriteriaType.LearnTradeskillSkillLine: case CriteriaType.LearnTradeskillSkillLine:
{ {
uint spellCount = 0; uint spellCount = 0;
foreach (var spell in referencePlayer.GetSpellMap()) foreach (var (spellId, _) in referencePlayer.GetSpellMap())
{ {
var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spell.Key); var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spellId);
foreach (var skill in bounds) foreach (var skill in bounds)
{ {
if (skill.SkillLine == criteria.Entry.Asset) if (skill.SkillLine == criteria.Entry.Asset)
@@ -730,7 +730,7 @@ namespace Game.Chat
} }
[CommandNonGroup("levelup", RBACPermissions.CommandLevelup)] [CommandNonGroup("levelup", RBACPermissions.CommandLevelup)]
static bool LevelUp(CommandHandler handler, StringArguments args) static bool HandleLevelUpCommand(CommandHandler handler, StringArguments args)
{ {
string nameStr; string nameStr;
string levelStr; string levelStr;
+2 -2
View File
@@ -206,7 +206,7 @@ namespace Game.Chat
WorldLocation loc = new(result.Read<ushort>(0), result.Read<float>(2), result.Read<float>(3), result.Read<float>(4), 0.0f); WorldLocation loc = new(result.Read<ushort>(0), result.Read<float>(2), result.Read<float>(3), result.Read<float>(4), 0.0f);
uint zoneId = result.Read<ushort>(1); uint zoneId = result.Read<ushort>(1);
Player.SavePositionInDB(loc, zoneId, targetGuid, null); Player.SavePositionInDB(loc, zoneId, targetGuid);
} }
} }
@@ -258,7 +258,7 @@ namespace Game.Chat
handler.SendSysMessage(CypherStrings.TeleportingTo, nameLink, handler.GetCypherString(CypherStrings.Offline), tele.name); handler.SendSysMessage(CypherStrings.TeleportingTo, nameLink, handler.GetCypherString(CypherStrings.Offline), tele.name);
Player.SavePositionInDB(new WorldLocation(tele.mapId, tele.posX, tele.posY, tele.posZ, tele.orientation), Player.SavePositionInDB(new WorldLocation(tele.mapId, tele.posX, tele.posY, tele.posZ, tele.orientation),
Global.MapMgr.GetZoneId(PhasingHandler.EmptyPhaseShift, tele.mapId, tele.posX, tele.posY, tele.posZ), targetGuid, null); Global.MapMgr.GetZoneId(PhasingHandler.EmptyPhaseShift, tele.mapId, tele.posX, tele.posY, tele.posZ), targetGuid);
} }
return true; return true;
+8 -4
View File
@@ -4142,11 +4142,15 @@ namespace Game.Maps
{ {
if (summoner != null && smoothPhasingInfo.ReplaceObject.HasValue) if (summoner != null && smoothPhasingInfo.ReplaceObject.HasValue)
{ {
SmoothPhasingInfo originalSmoothPhasingInfo = smoothPhasingInfo; WorldObject replacedObject = Global.ObjAccessor.GetWorldObject(summoner, smoothPhasingInfo.ReplaceObject.Value);
originalSmoothPhasingInfo.ReplaceObject = summon.GetGUID(); if (replacedObject != null)
summoner.GetOrCreateSmoothPhasing().SetViewerDependentInfo(privateObjectOwner, originalSmoothPhasingInfo); {
SmoothPhasingInfo originalSmoothPhasingInfo = smoothPhasingInfo;
originalSmoothPhasingInfo.ReplaceObject = summon.GetGUID();
replacedObject.GetOrCreateSmoothPhasing().SetViewerDependentInfo(privateObjectOwner, originalSmoothPhasingInfo);
summon.SetDemonCreatorGUID(privateObjectOwner); summon.SetDemonCreatorGUID(privateObjectOwner);
}
} }
summon.GetOrCreateSmoothPhasing().SetSingleInfo(smoothPhasingInfo); summon.GetOrCreateSmoothPhasing().SetSingleInfo(smoothPhasingInfo);