Skip to content

Commit

Permalink
Improve push/read function checks
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Jan 7, 2025
1 parent a293f51 commit b1aba81
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/script/cpp_api/s_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ void ScriptApiBase::checkSetByBuiltin()
{
lua_State *L = getStack();

if (m_gamedef && getType() != ScriptingType::PauseMenu) {
CHECK(CUSTOM_RIDX_READ_VECTOR, "read_vector");
CHECK(CUSTOM_RIDX_PUSH_VECTOR, "push_vector");
CHECK(CUSTOM_RIDX_READ_VECTOR, "read_vector");
CHECK(CUSTOM_RIDX_PUSH_VECTOR, "push_vector");

if (getType() == ScriptingType::Server ||
(getType() == ScriptingType::Async && m_gamedef) ||
getType() == ScriptingType::Emerge ||
getType() == ScriptingType::Client) {
CHECK(CUSTOM_RIDX_READ_NODE, "read_node");
CHECK(CUSTOM_RIDX_PUSH_NODE, "push_node");
}
Expand Down

0 comments on commit b1aba81

Please sign in to comment.