mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
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
This commit is contained in:
committed by
Perttu Ahola
parent
756db8174a
commit
3d1c481f0b
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user