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 e74fa376d1
commit 12d896776a
5 changed files with 15 additions and 0 deletions

View file

@ -3,6 +3,7 @@
#include "ScriptAssert.h"
#include "GameScriptSinkInfo.h"
#include "GameScriptPosition.h"
#include "ScriptUtil.h"
#include <sol.hpp>
/***
Sink info
@ -14,6 +15,7 @@ Sink info
constexpr auto LUA_CLASS_NAME{ "SinkInfo" };
static auto index_error = index_error_maker(GameScriptSinkInfo, LUA_CLASS_NAME);
static auto newindex_error = newindex_error_maker(GameScriptSinkInfo, LUA_CLASS_NAME);
GameScriptSinkInfo::GameScriptSinkInfo(SINK_INFO & ref, bool temp) : m_sink{ref}, m_temporary{ temp }
{};
@ -29,6 +31,7 @@ void GameScriptSinkInfo::Register(sol::state* state)
{
state->new_usertype<GameScriptSinkInfo>(LUA_CLASS_NAME,
sol::meta_function::index, index_error,
sol::meta_function::new_index, newindex_error,
/// (@{Position}) position in level
// @mem pos