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

@ -2,6 +2,7 @@
#include "ScriptAssert.h"
#include "GameScriptCameraInfo.h"
#include "GameScriptPosition.h"
#include "ScriptUtil.h"
/***
Camera info
@ -12,6 +13,7 @@ Camera info
static constexpr auto LUA_CLASS_NAME{ "CameraInfo" };
static auto index_error = index_error_maker(GameScriptCameraInfo, LUA_CLASS_NAME);
static auto newindex_error = newindex_error_maker(GameScriptCameraInfo, LUA_CLASS_NAME);
GameScriptCameraInfo::GameScriptCameraInfo(LEVEL_CAMERA_INFO & ref, bool temp) : m_camera{ref}, m_temporary{ temp }
{};
@ -27,6 +29,7 @@ void GameScriptCameraInfo::Register(sol::state* state)
{
state->new_usertype<GameScriptCameraInfo>(LUA_CLASS_NAME,
sol::meta_function::index, index_error,
sol::meta_function::new_index, newindex_error,
/// (@{Position}) position in level
// @mem pos