Cleanup errors and misc fixes

This commit is contained in:
hondacrx
2017-11-05 15:48:55 -05:00
parent 76b8c4a10d
commit 0df2703eab
3 changed files with 14 additions and 30 deletions
+1 -9
View File
@@ -3638,7 +3638,7 @@ namespace Game.AI
if (scene != null)
Log.outDebug(LogFilter.ScriptsAi, "SmartScript: EventMap for SceneId {0} is empty but is using SmartScript.", scene.SceneId);
if (spell != null)
Log.outDebug(LogFilter.ScriptsAi, "SmartScript: EventMap for SceneId {0} is empty but is using SmartScript.", scene.SceneId);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript: EventMap for SpellId {0} is empty but is using SmartScript.", spell.GetSpellInfo().Id);
return;
}
foreach (var holder in e)
@@ -3656,14 +3656,6 @@ namespace Game.AI
}
mEvents.Add(holder);//NOTE: 'world(0)' events still get processed in ANY instance mode
}
if (mEvents.Empty() && obj != null)
Log.outError(LogFilter.Sql, "SmartScript: Entry {0} has events but no events added to list because of instance flags.", obj.GetEntry());
if (mEvents.Empty() && at != null)
Log.outError(LogFilter.Sql, "SmartScript: AreaTrigger {0} has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at.Id);
if (mEvents.Empty() && scene != null)
Log.outError(LogFilter.Sql, "SmartScript: SceneId {0} has events but no events added to list because of instance flags. NOTE: scenes can not handle any instance flags.", scene.SceneId);
if (mEvents.Empty() && spell != null)
Log.outError(LogFilter.Sql, "SmartScript: Spell {0} has events but no events added to list because of instance flags. NOTE: scenes can not handle any instance flags.", spell.GetSpellInfo().Id);
}
void GetScript()
+1 -1
View File
@@ -561,7 +561,7 @@ namespace Game.Chat
// command.getSession() == NULL only for console
targetAccountId = (isAccountNameGiven) ? Global.AccountMgr.GetId(targetAccountName) : handler.getSelectedPlayer().GetSession().GetAccountId();
if (int.TryParse(isAccountNameGiven ? arg3 : arg2, out int gmRealmID))
if (!int.TryParse(isAccountNameGiven ? arg3 : arg2, out int gmRealmID))
return false;
AccountTypes playerSecurity;
+12 -20
View File
@@ -725,12 +725,6 @@ namespace Game
bool isSourceTypeValid(Condition cond)
{
if (cond.SourceType == ConditionSourceType.None || cond.SourceType >= ConditionSourceType.Max)
{
Log.outError(LogFilter.Sql, "{0} Invalid ConditionSourceType in `condition` table, ignoring.", cond.ToString());
return false;
}
switch (cond.SourceType)
{
case ConditionSourceType.CreatureLootTemplate:
@@ -1079,8 +1073,9 @@ namespace Game
case ConditionSourceType.GossipMenu:
case ConditionSourceType.GossipMenuOption:
case ConditionSourceType.SmartEvent:
case ConditionSourceType.None:
break;
default:
Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionSourceType in `condition` table, ignoring.");
break;
}
@@ -1089,18 +1084,6 @@ namespace Game
bool isConditionTypeValid(Condition cond)
{
if (cond.ConditionType == ConditionTypes.None || cond.ConditionType >= ConditionTypes.Max)
{
Log.outError(LogFilter.Sql, "{0} Invalid ConditionType in `condition` table, ignoring.", cond.ToString());
return false;
}
if (cond.ConditionTarget >= cond.GetMaxAvailableConditionTargets())
{
Log.outError(LogFilter.Sql, "{0} in `condition` table, has incorrect ConditionTarget set, ignoring.", cond.ToString());
return false;
}
switch (cond.ConditionType)
{
case ConditionTypes.Aura:
@@ -1584,11 +1567,20 @@ namespace Game
case ConditionTypes.Alive:
case ConditionTypes.Areaid:
case ConditionTypes.InstanceInfo:
case ConditionTypes.TerrainSwap:
case ConditionTypes.InWater:
case ConditionTypes.Charmed:
case ConditionTypes.Taxi:
default:
break;
default:
Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionType in `condition` table, ignoring.");
return false;
}
if (cond.ConditionTarget >= cond.GetMaxAvailableConditionTargets())
{
Log.outError(LogFilter.Sql, $"{cond.ToString(true)} in `condition` table, has incorrect ConditionTarget set, ignoring.");
return false;
}
if (cond.ConditionValue1 != 0 && !StaticConditionTypeData[(int)cond.ConditionType].HasConditionValue1)