From 7e56637ed07d9f32b4bd9049009cf7e1e4cff884 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 3 Mar 2015 16:23:47 +0100 Subject: Send Breath packet on event, don't check it at each AsyncRunStep --- src/script/lua_api/l_object.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/script/lua_api/l_object.cpp') 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; } -- cgit v1.2.3