summaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api/s_player.cpp')
-rw-r--r--src/script/cpp_api/s_player.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/script/cpp_api/s_player.cpp b/src/script/cpp_api/s_player.cpp
index 676b07537..ef3c31cfd 100644
--- a/src/script/cpp_api/s_player.cpp
+++ b/src/script/cpp_api/s_player.cpp
@@ -32,7 +32,7 @@ void ScriptApiPlayer::on_newplayer(ServerActiveObject *player)
lua_getfield(L, -1, "registered_on_newplayers");
// Call callbacks
objectrefGetOrCreate(L, player);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
}
void ScriptApiPlayer::on_dieplayer(ServerActiveObject *player)
@@ -44,7 +44,7 @@ void ScriptApiPlayer::on_dieplayer(ServerActiveObject *player)
lua_getfield(L, -1, "registered_on_dieplayers");
// Call callbacks
objectrefGetOrCreate(L, player);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
}
bool ScriptApiPlayer::on_punchplayer(ServerActiveObject *player,
@@ -65,7 +65,7 @@ bool ScriptApiPlayer::on_punchplayer(ServerActiveObject *player,
push_tool_capabilities(L, *toolcap);
push_v3f(L, dir);
lua_pushnumber(L, damage);
- script_run_callbacks(L, 6, RUN_CALLBACKS_MODE_OR);
+ runCallbacks(6, RUN_CALLBACKS_MODE_OR);
return lua_toboolean(L, -1);
}
@@ -96,7 +96,7 @@ bool ScriptApiPlayer::on_respawnplayer(ServerActiveObject *player)
lua_getfield(L, -1, "registered_on_respawnplayers");
// Call callbacks
objectrefGetOrCreate(L, player);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_OR);
+ runCallbacks(1, RUN_CALLBACKS_MODE_OR);
bool positioning_handled_by_some = lua_toboolean(L, -1);
return positioning_handled_by_some;
}
@@ -113,7 +113,7 @@ bool ScriptApiPlayer::on_prejoinplayer(
lua_getfield(L, -1, "registered_on_prejoinplayers");
lua_pushstring(L, name.c_str());
lua_pushstring(L, ip.c_str());
- script_run_callbacks(L, 2, RUN_CALLBACKS_MODE_OR);
+ runCallbacks(2, RUN_CALLBACKS_MODE_OR);
if (lua_isstring(L, -1)) {
reason->assign(lua_tostring(L, -1));
return true;
@@ -130,7 +130,7 @@ void ScriptApiPlayer::on_joinplayer(ServerActiveObject *player)
lua_getfield(L, -1, "registered_on_joinplayers");
// Call callbacks
objectrefGetOrCreate(L, player);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
}
void ScriptApiPlayer::on_leaveplayer(ServerActiveObject *player)
@@ -142,7 +142,7 @@ void ScriptApiPlayer::on_leaveplayer(ServerActiveObject *player)
lua_getfield(L, -1, "registered_on_leaveplayers");
// Call callbacks
objectrefGetOrCreate(L, player);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
}
void ScriptApiPlayer::on_cheat(ServerActiveObject *player,
@@ -158,7 +158,7 @@ void ScriptApiPlayer::on_cheat(ServerActiveObject *player,
lua_newtable(L);
lua_pushlstring(L, cheat_type.c_str(), cheat_type.size());
lua_setfield(L, -2, "type");
- script_run_callbacks(L, 2, RUN_CALLBACKS_MODE_FIRST);
+ runCallbacks(2, RUN_CALLBACKS_MODE_FIRST);
}
void ScriptApiPlayer::on_playerReceiveFields(ServerActiveObject *player,
@@ -185,7 +185,7 @@ void ScriptApiPlayer::on_playerReceiveFields(ServerActiveObject *player,
lua_pushlstring(L, value.c_str(), value.size());
lua_settable(L, -3);
}
- script_run_callbacks(L, 3, RUN_CALLBACKS_MODE_OR_SC);
+ runCallbacks(3, RUN_CALLBACKS_MODE_OR_SC);
}
ScriptApiPlayer::~ScriptApiPlayer()