Some cleanups

This commit is contained in:
hondacrx
2021-07-08 13:01:46 -04:00
parent 970ac30730
commit 50fcbd3aaf
9 changed files with 14 additions and 23 deletions
+2 -8
View File
@@ -1245,7 +1245,6 @@ namespace Game.Chat
if (string.IsNullOrEmpty(guid_str))
return false;
ulong lowguid;
Creature creature = null;
if (!string.IsNullOrEmpty(dontdel_str))
@@ -1279,11 +1278,10 @@ namespace Game.Chat
creature = handler.GetSelectedCreature();
if (!creature || creature.IsPet())
return false;
lowguid = creature.GetSpawnId();
}
else // case .setmovetype #creature_guid $move_type (with selected creature)
{
if (!ulong.TryParse(guid_str, out lowguid) || lowguid != 0)
if (!ulong.TryParse(guid_str, out ulong lowguid) || lowguid != 0)
creature = handler.GetCreatureFromPlayerMapByDbGuid(lowguid);
// attempt check creature existence by DB data
@@ -1296,10 +1294,6 @@ namespace Game.Chat
return false;
}
}
else
{
lowguid = creature.GetSpawnId();
}
}
// now lowguid is low guid really existed creature
@@ -1331,7 +1325,7 @@ namespace Game.Chat
}
creature.SaveToDB();
}
if (doNotDelete == false)
if (!doNotDelete)
{
handler.SendSysMessage(CypherStrings.MoveTypeSet, type);
}