aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-08-21 17:27:52 +0200
committersapier <Sapier at GMX dot net>2014-08-21 17:29:26 +0200
commit2a5c88bde167c69b178d6c5ed4d702cadc211ded (patch)
treec0abd05092b698679add61781a799eb036cb699c /src/script/cpp_api
parenta4c987b339a7397f01da29f285313405a2551b7e (diff)
downloadminetest-2a5c88bde167c69b178d6c5ed4d702cadc211ded.tar.gz
minetest-2a5c88bde167c69b178d6c5ed4d702cadc211ded.tar.bz2
minetest-2a5c88bde167c69b178d6c5ed4d702cadc211ded.zip
Don't call a player event without having player to do a event for
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r--src/script/cpp_api/s_env.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp
index 9ac9302ac..4b5feee96 100644
--- a/src/script/cpp_api/s_env.cpp
+++ b/src/script/cpp_api/s_env.cpp
@@ -61,6 +61,9 @@ void ScriptApiEnv::environment_Step(float dtime)
void ScriptApiEnv::player_event(ServerActiveObject* player, std::string type)
{
SCRIPTAPI_PRECHECKHEADER
+
+ if (player == NULL)
+ return;
// Get minetest.registered_playerevents
lua_getglobal(L, "minetest");