Cleanup errors and misc fixes
This commit is contained in:
@@ -3638,7 +3638,7 @@ namespace Game.AI
|
|||||||
if (scene != null)
|
if (scene != 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 SceneId {0} is empty but is using SmartScript.", scene.SceneId);
|
||||||
if (spell != null)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
foreach (var holder in e)
|
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
|
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()
|
void GetScript()
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
// command.getSession() == NULL only for console
|
// command.getSession() == NULL only for console
|
||||||
targetAccountId = (isAccountNameGiven) ? Global.AccountMgr.GetId(targetAccountName) : handler.getSelectedPlayer().GetSession().GetAccountId();
|
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;
|
return false;
|
||||||
|
|
||||||
AccountTypes playerSecurity;
|
AccountTypes playerSecurity;
|
||||||
|
|||||||
@@ -725,12 +725,6 @@ namespace Game
|
|||||||
|
|
||||||
bool isSourceTypeValid(Condition cond)
|
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)
|
switch (cond.SourceType)
|
||||||
{
|
{
|
||||||
case ConditionSourceType.CreatureLootTemplate:
|
case ConditionSourceType.CreatureLootTemplate:
|
||||||
@@ -1079,8 +1073,9 @@ namespace Game
|
|||||||
case ConditionSourceType.GossipMenu:
|
case ConditionSourceType.GossipMenu:
|
||||||
case ConditionSourceType.GossipMenuOption:
|
case ConditionSourceType.GossipMenuOption:
|
||||||
case ConditionSourceType.SmartEvent:
|
case ConditionSourceType.SmartEvent:
|
||||||
case ConditionSourceType.None:
|
break;
|
||||||
default:
|
default:
|
||||||
|
Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionSourceType in `condition` table, ignoring.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1089,18 +1084,6 @@ namespace Game
|
|||||||
|
|
||||||
bool isConditionTypeValid(Condition cond)
|
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)
|
switch (cond.ConditionType)
|
||||||
{
|
{
|
||||||
case ConditionTypes.Aura:
|
case ConditionTypes.Aura:
|
||||||
@@ -1584,11 +1567,20 @@ namespace Game
|
|||||||
case ConditionTypes.Alive:
|
case ConditionTypes.Alive:
|
||||||
case ConditionTypes.Areaid:
|
case ConditionTypes.Areaid:
|
||||||
case ConditionTypes.InstanceInfo:
|
case ConditionTypes.InstanceInfo:
|
||||||
|
case ConditionTypes.TerrainSwap:
|
||||||
case ConditionTypes.InWater:
|
case ConditionTypes.InWater:
|
||||||
case ConditionTypes.Charmed:
|
case ConditionTypes.Charmed:
|
||||||
case ConditionTypes.Taxi:
|
case ConditionTypes.Taxi:
|
||||||
default:
|
|
||||||
break;
|
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)
|
if (cond.ConditionValue1 != 0 && !StaticConditionTypeData[(int)cond.ConditionType].HasConditionValue1)
|
||||||
|
|||||||
Reference in New Issue
Block a user