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:
parent
64ff966bae
commit
7e56637ed0
6 changed files with 16 additions and 16 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue