1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Send Breath packet on event, don't check it at each AsyncRunStep

This commit is contained in:
Loic Blot 2015-03-03 16:23:47 +01:00
parent 64ff966bae
commit 7e56637ed0
6 changed files with 16 additions and 16 deletions

View file

@ -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;
}