mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 05:31:29 +00:00
Fix MSG_ReadDeltaKey setting bit 1<<bits often
MSG_ReadDeltaKey would often set 1<<bits, it should never be set. It exceeds the size of what was being read. Worked okay for weapons/forward/right/up as they stored as chars (value would wrap around to correct value, lucky). Angles had the wrong value, not sure if it was causing issues.
This commit is contained in:
parent
517c65d85e
commit
b4ad5a8411
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ void MSG_WriteDeltaKey( msg_t *msg, int key, int oldV, int newV, int bits ) {
|
|||
|
||||
int MSG_ReadDeltaKey( msg_t *msg, int key, int oldV, int bits ) {
|
||||
if ( MSG_ReadBits( msg, 1 ) ) {
|
||||
return MSG_ReadBits( msg, bits ) ^ (key & kbitmask[bits]);
|
||||
return MSG_ReadBits( msg, bits ) ^ (key & kbitmask[ bits - 1 ]);
|
||||
}
|
||||
return oldV;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue