mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
Give newindex errors to script classes which already have index errors.
This commit is contained in:
parent
178b66978a
commit
51c3ffe3d3
5 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "GameScriptAIObject.h"
|
||||
#include "ScriptAssert.h"
|
||||
#include "GameScriptPosition.h"
|
||||
#include "ScriptUtil.h"
|
||||
#include <sol.hpp>
|
||||
/***
|
||||
AI object
|
||||
|
@ -15,6 +16,7 @@ AI object
|
|||
constexpr auto LUA_CLASS_NAME{ "AIObject" };
|
||||
|
||||
static auto index_error = index_error_maker(GameScriptAIObject, LUA_CLASS_NAME);
|
||||
static auto newindex_error = newindex_error_maker(GameScriptAIObject, LUA_CLASS_NAME);
|
||||
|
||||
GameScriptAIObject::GameScriptAIObject(AI_OBJECT & ref, bool temp) : m_aiObject{ref}, m_temporary{ temp }
|
||||
{};
|
||||
|
@ -30,6 +32,7 @@ void GameScriptAIObject::Register(sol::state* state)
|
|||
{
|
||||
state->new_usertype<GameScriptAIObject>(LUA_CLASS_NAME,
|
||||
sol::meta_function::index, index_error,
|
||||
sol::meta_function::new_index, newindex_error,
|
||||
|
||||
/// (@{Position}) position in level
|
||||
// @mem pos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue