summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
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;
}