diff --git a/changelog.txt b/changelog.txt index 88180df59..c6b13dbaa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/01/2015 == +demonstar55: Add quest debugging to lua + eq.debug("Test debug level implicit 1") + eq.debug("Test debug level explicit 1", 1) + eq.debug("Test debug level explicit 2", 2) + eq.debug("Test debug level explicit 3", 3) + == 01/31/2015 == Trevius: Fixed FindGroundZ() and GetGroundZ() to once again utilize the X and Y arguments that are passed to them. diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index cdf42005d..50afdb6e9 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -17,6 +17,7 @@ #include "questmgr.h" #include "qglobals.h" #include "../common/timer.h" +#include "../common/eqemu_logsys.h" struct Events { }; struct Factions { }; @@ -1221,7 +1222,6 @@ std::string lua_get_encounter() { return quest_manager.GetEncounter(); } - void lua_map_opcodes() { MapOpcodes(); } @@ -1249,6 +1249,17 @@ double lua_clock() { return static_cast(t) / 1000.0; } +void lua_debug(std::string message) { + Log.Out(Logs::General, Logs::QuestDebug, message); +} + +void lua_debug(std::string message, int level) { + if (level < Logs::General || level > Logs::Detail) + return; + + Log.Out(static_cast(level), Logs::QuestDebug, message); +} + #define LuaCreateNPCParse(name, c_type, default_value) do { \ cur = table[#name]; \ if(luabind::type(cur) != LUA_TNIL) { \ @@ -1582,7 +1593,9 @@ luabind::scope lua_register_general() { luabind::def("disable_recipe", &lua_disable_recipe), luabind::def("clear_npctype_cache", &lua_clear_npctype_cache), luabind::def("clock", &lua_clock), - luabind::def("create_npc", &lua_create_npc) + luabind::def("create_npc", &lua_create_npc), + luabind::def("debug", (void(*)(std::string))&lua_debug), + luabind::def("debug", (void(*)(std::string, int))&lua_debug) ]; }