Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Nov 23, 2024
1 parent d43f7f8 commit 7d135c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/script/cpp_api/s_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void ScriptApiEntity::luaentity_GetProperties(u16 id,
bool ScriptApiEntity::luaentity_Step(u16 id, float dtime,
const collisionMoveResult *moveresult)
{
TRY_SCRIPTAPI_PRECHECKHEADER
TRY_SCRIPTAPI_PRECHECKHEADER({})

int error_handler = PUSH_ERROR_HANDLER(L);

Expand Down
2 changes: 1 addition & 1 deletion src/script/cpp_api/s_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp,

void ScriptApiEnv::environment_Step(float dtime)
{
TRY_SCRIPTAPI_PRECHECKHEADER
TRY_SCRIPTAPI_PRECHECKHEADER()

// Get core.registered_globalsteps
lua_getglobal(L, "core");
Expand Down
4 changes: 2 additions & 2 deletions src/script/cpp_api/s_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class LockChecker {
#define SCRIPTAPI_LOCK_CHECK while(0)
#endif

#define TRY_SCRIPTAPI_PRECHECKHEADER \
#define TRY_SCRIPTAPI_PRECHECKHEADER(RET) \
const std::unique_lock<std::recursive_mutex> scriptlock(this->m_luastackmutex, std::try_to_lock); \
if (!scriptlock.owns_lock()) { /* DUMP("skiplock", scriptlock); */ return {}; } \
if (!scriptlock.owns_lock()) { /* DUMP("skiplock", scriptlock); */ return RET; } \
SCRIPTAPI_LOCK_CHECK; \
realityCheck(); \
lua_State *L = getStack(); \
Expand Down

0 comments on commit 7d135c4

Please sign in to comment.