aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-01-01 16:13:01 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2017-01-01 23:11:26 +0100
commit52ba1f867e5edb579a59a44fbb8286d4f1e54931 (patch)
treed95e2032d3fcf18bd972cc018e6b44470664d75c /src/script
parenta1346c916e1d0f0cde2ccecc680857896c717a3d (diff)
downloadminetest-52ba1f867e5edb579a59a44fbb8286d4f1e54931.tar.gz
minetest-52ba1f867e5edb579a59a44fbb8286d4f1e54931.tar.bz2
minetest-52ba1f867e5edb579a59a44fbb8286d4f1e54931.zip
Breath cheat fix: server side
Breath is now handled server side. Changing this behaviour required some modifications to core: * Ignore TOSERVER_BREATH package, marking it as obsolete * Clients doesn't send the breath to server anymore * Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain) * drop a useless static_cast in emergePlayer
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_object.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index 2a8b8a64e..cfdceb28e 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -1152,13 +1152,8 @@ int ObjectRef::l_set_breath(lua_State *L)
PlayerSAO* co = getplayersao(ref);
if (co == NULL) return 0;
u16 breath = luaL_checknumber(L, 2);
- // Do it
co->setBreath(breath);
- // 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;
}