X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fgenericobject.cpp;h=9a1b9d8d0dc657b109220b3d2a2d5877cce5277d;hb=718bcafd5174690a7731f9b04873e9a09f7a47b7;hp=398b07feb3a04e920fcbbf4df1b11719b75b6b77;hpb=bb454b184656735b51fea17a0cb6276514b1c8c1;p=minetest.git diff --git a/src/genericobject.cpp b/src/genericobject.cpp index 398b07feb..9a1b9d8d0 100644 --- a/src/genericobject.cpp +++ b/src/genericobject.cpp @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2012 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -117,6 +117,22 @@ std::string gob_cmd_update_armor_groups(const ItemGroupList &armor_groups) return os.str(); } +std::string gob_cmd_update_physics_override(float physics_override_speed, float physics_override_jump, + float physics_override_gravity, bool sneak, bool sneak_glitch) +{ + std::ostringstream os(std::ios::binary); + // command + writeU8(os, GENERIC_CMD_SET_PHYSICS_OVERRIDE); + // parameters + writeF1000(os, physics_override_speed); + writeF1000(os, physics_override_jump); + writeF1000(os, physics_override_gravity); + // these are sent inverted so we get true when the server sends nothing + writeU8(os, !sneak); + writeU8(os, !sneak_glitch); + return os.str(); +} + std::string gob_cmd_update_animation(v2f frames, float frame_speed, float frame_blend) { std::ostringstream os(std::ios::binary);