mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 20:46:47 +03:00
Move index_error_maker into new file (ScriptUtil.h). Add newindex_error_maker. Make them call ScriptAssert instead of just throwing an exception so it won't terminate the application on WARN or SILENT error modes.
This commit is contained in:
parent
6727138e64
commit
e74fa376d1
4 changed files with 17 additions and 7 deletions
|
@ -3,13 +3,6 @@
|
|||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
|
||||
#define index_error_maker(CPP_TYPE, LUA_CLASS_NAME) [](CPP_TYPE & item, sol::object key) \
|
||||
{ \
|
||||
std::string err = "Attempted to read non-existant var \"" + key.as<std::string>() + "\" from " + LUA_CLASS_NAME; \
|
||||
throw TENScriptException(err); \
|
||||
}
|
||||
|
||||
template <typename S> using callbackSetName = std::function<bool(std::string const&, S identifier)>;
|
||||
using callbackRemoveName = std::function<bool(std::string const&)>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue