Some cleanups. (might break build for scripts as they are a WIP)
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Game.Chat
|
||||
static bool HandleGameObjectActivateCommand(CommandHandler handler, ulong guidLow)
|
||||
{
|
||||
GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandObjnotfound, guidLow);
|
||||
return false;
|
||||
@@ -48,7 +48,7 @@ namespace Game.Chat
|
||||
if (!ownerGuid.IsEmpty())
|
||||
{
|
||||
Unit owner = Global.ObjAccessor.GetUnit(player, ownerGuid);
|
||||
if (!owner || !ownerGuid.IsPlayer())
|
||||
if (owner == null || !ownerGuid.IsPlayer())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandDelobjrefercreature, ownerGuid.ToString(), obj.GetGUID().ToString());
|
||||
return false;
|
||||
@@ -189,7 +189,7 @@ namespace Game.Chat
|
||||
static bool HandleGameObjectMoveCommand(CommandHandler handler, ulong guidLow, float[] xyz)
|
||||
{
|
||||
GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandObjnotfound, guidLow);
|
||||
return false;
|
||||
@@ -227,7 +227,7 @@ namespace Game.Chat
|
||||
obj.Delete();
|
||||
|
||||
obj = GameObject.CreateGameObjectFromDB(guidLow, map);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
handler.SendSysMessage(CypherStrings.CommandMoveobjmessage, obj.GetSpawnId(), obj.GetGoInfo().name, obj.GetGUID().ToString());
|
||||
@@ -418,7 +418,7 @@ namespace Game.Chat
|
||||
|
||||
handler.SendSysMessage(CypherStrings.GameobjectDetail, guidLow, objectInfo.name, guidLow, id, x, y, z, mapId, o, phaseId, phaseGroup);
|
||||
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
int curRespawnDelay = (int)(target.GetRespawnTimeEx() - GameTime.GetGameTime());
|
||||
if (curRespawnDelay < 0)
|
||||
@@ -436,7 +436,7 @@ namespace Game.Chat
|
||||
static bool HandleGameObjectTurnCommand(CommandHandler handler, ulong guidLow, float? oz, float? oy, float? ox)
|
||||
{
|
||||
GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandObjnotfound, guidLow);
|
||||
return false;
|
||||
@@ -458,7 +458,7 @@ namespace Game.Chat
|
||||
obj.Delete();
|
||||
|
||||
obj = GameObject.CreateGameObjectFromDB(guidLow, map);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
handler.SendSysMessage(CypherStrings.CommandTurnobjmessage, obj.GetSpawnId(), obj.GetGoInfo().name, obj.GetGUID().ToString(), obj.GetOrientation());
|
||||
@@ -494,7 +494,7 @@ namespace Game.Chat
|
||||
Map map = player.GetMap();
|
||||
|
||||
GameObject obj = GameObject.CreateGameObject(objectInfo.entry, map, player, Quaternion.CreateFromRotationMatrix(Extensions.fromEulerAnglesZYX(player.GetOrientation(), 0.0f, 0.0f)), 255, GameObjectState.Ready);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
PhasingHandler.InheritPhaseShift(obj, player);
|
||||
@@ -508,7 +508,7 @@ namespace Game.Chat
|
||||
|
||||
// this will generate a new guid if the object is in an instance
|
||||
obj = GameObject.CreateGameObjectFromDB(spawnId, map);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
// TODO: is it really necessary to add both the real and DB table guid here ?
|
||||
@@ -546,7 +546,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandObjnotfound, guidLow);
|
||||
return false;
|
||||
@@ -570,7 +570,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandObjnotfound, guidLow);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user