aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-03 16:23:47 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-03 16:33:20 +0100
commit7e56637ed07d9f32b4bd9049009cf7e1e4cff884 (patch)
treef683ef8fbbd078bee6c8465850e20d580225952a /src/script
parent64ff966bae99813229dff6629fd9131a91ba7484 (diff)
downloadminetest-7e56637ed07d9f32b4bd9049009cf7e1e4cff884.tar.gz
minetest-7e56637ed07d9f32b4bd9049009cf7e1e4cff884.tar.bz2
minetest-7e56637ed07d9f32b4bd9049009cf7e1e4cff884.zip
Send Breath packet on event, don't check it at each AsyncRunStep
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_object.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index e6a50c3ba..0bc6c0bbc 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -812,7 +812,11 @@ int ObjectRef::l_set_breath(lua_State *L)
u16 breath = luaL_checknumber(L, 2);
// Do it
co->setBreath(breath);
- co->m_breath_not_sent = true;
+
+ // If the object is a player sent the breath to client
+ if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER)
+ getServer(L)->SendPlayerBreath(((PlayerSAO*)co)->getPeerID());
+
return 0;
}