Give newindex errors to script classes which already have index errors.

This commit is contained in:
hispidence 2021-08-20 01:41:14 +01:00
parent 178b66978a
commit 51c3ffe3d3
5 changed files with 15 additions and 0 deletions

View file

@ -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