aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index acb5ca1c35e..c826c0ea441 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -4429,11 +4429,11 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
tmp.o = fields[9].GetFloat();
// generic command args check
- switch(tmp.command)
+ switch (tmp.command)
{
case SCRIPT_COMMAND_TALK:
{
- if (tmp.datalong > 4)
+ if (tmp.datalong > CHAT_TYPE_WHISPER)
{
sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.datalong,tmp.id);
continue;
@@ -4631,6 +4631,23 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
}
break;
}
+
+ case SCRIPT_COMMAND_CREATE_ITEM:
+ {
+ if (!GetItemPrototype(tmp.datalong))
+ {
+ sLog.outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
+ tablename, tmp.datalong, tmp.id);
+ continue;
+ }
+ if (!tmp.datalong2)
+ {
+ sLog.outErrorDb("Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
+ tablename, tmp.datalong2, tmp.id);
+ continue;
+ }
+ break;
+ }
}
if (scripts.find(tmp.id) == scripts.end())
@@ -4763,6 +4780,7 @@ void ObjectMgr::LoadEventScripts()
}
}
}
+
// Then check if all scripts are in above list of possible script entries
for (ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr)
{