summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2012-11-22 21:01:31 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 19:14:24 +0200
commit3d1c481f0bdf03b59871237d810685278e87613b (patch)
treefe49c10e926b1e452e4f98561a148e2f145c27e9 /src/client.cpp
parent756db8174aa6a05eb998cfcec8eb5127053c5ea9 (diff)
downloadminetest-3d1c481f0bdf03b59871237d810685278e87613b.tar.gz
minetest-3d1c481f0bdf03b59871237d810685278e87613b.tar.bz2
minetest-3d1c481f0bdf03b59871237d810685278e87613b.zip
RealBadAngel's patch which allows the lua api to read pressed player keys. This should make it possible to change the player's animation based on what he is doing
Correct lua api version number Always update animations and attachments after the entity is added to scene client side. Fixes animations not being applied in client initialization for some reason. Attachments should be re-tested now just to be safe. Fix a segmentation fault caused by reaching materials that didn't exist in a loop for setting texture
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 9a056806b..f72c4b654 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1984,7 +1984,7 @@ void Client::sendPlayerPos()
v3s32 speed(sf.X*100, sf.Y*100, sf.Z*100);
s32 pitch = myplayer->getPitch() * 100;
s32 yaw = myplayer->getYaw() * 100;
-
+ u32 keyPressed=myplayer->keyPressed;
/*
Format:
[0] u16 command
@@ -1992,15 +1992,15 @@ void Client::sendPlayerPos()
[2+12] v3s32 speed*100
[2+12+12] s32 pitch*100
[2+12+12+4] s32 yaw*100
+ [2+12+12+4+4] u32 keyPressed
*/
-
- SharedBuffer<u8> data(2+12+12+4+4);
+ SharedBuffer<u8> data(2+12+12+4+4+4);
writeU16(&data[0], TOSERVER_PLAYERPOS);
writeV3S32(&data[2], position);
writeV3S32(&data[2+12], speed);
writeS32(&data[2+12+12], pitch);
- writeS32(&data[2+12+12+4], yaw);
-
+ writeS32(&data[2+12+12+4], yaw);
+ writeU32(&data[2+12+12+4+4], keyPressed);
// Send as unreliable
Send(0, data, false);
}