diff options
| author | BiSaXa <1669855+BiSaXa@users.noreply.github.com> | 2022-08-31 23:58:02 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-16 21:39:35 +0300 |
| commit | 5e6ec6a7c1e90d7b362d4effb370ce4199525bd2 (patch) | |
| tree | 8f0ad60e87a8330893279daf4dd63bb682fdac57 /classes/userCmdInfo.go | |
| parent | janky bitreader, usercmdinfo almost finished (diff) | |
| download | sdp.go-5e6ec6a7c1e90d7b362d4effb370ce4199525bd2.tar.gz sdp.go-5e6ec6a7c1e90d7b362d4effb370ce4199525bd2.tar.bz2 sdp.go-5e6ec6a7c1e90d7b362d4effb370ce4199525bd2.zip | |
usercmdinfo buttons complete
Diffstat (limited to 'classes/userCmdInfo.go')
| -rw-r--r-- | classes/userCmdInfo.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/userCmdInfo.go b/classes/userCmdInfo.go index e91633d..55a8546 100644 --- a/classes/userCmdInfo.go +++ b/classes/userCmdInfo.go | |||
| @@ -13,7 +13,7 @@ type UserCmdInfo struct { | |||
| 13 | ForwardMove float32 | 13 | ForwardMove float32 |
| 14 | SideMove float32 | 14 | SideMove float32 |
| 15 | UpMove float32 | 15 | UpMove float32 |
| 16 | // Buttons int32 This could work but no idea on parsing buttons | 16 | Buttons int32 |
| 17 | // Impulse byte } | 17 | // Impulse byte } |
| 18 | // WeaponSelect int32 } | 18 | // WeaponSelect int32 } |
| 19 | // WeaponSubtype int32 Not worth the effort, no one cares about these | 19 | // WeaponSubtype int32 Not worth the effort, no one cares about these |
| @@ -31,7 +31,7 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { | |||
| 31 | classIndex := 0 | 31 | classIndex := 0 |
| 32 | // fmt.Println(byteArr) | 32 | // fmt.Println(byteArr) |
| 33 | // fmt.Printf("%08b", byteArr) | 33 | // fmt.Printf("%08b", byteArr) |
| 34 | for i := 0; i < 8; i++ { | 34 | for i := 0; i < 9; i++ { |
| 35 | if successCount+failedCount > 7 { | 35 | if successCount+failedCount > 7 { |
| 36 | failedCount = -successCount | 36 | failedCount = -successCount |
| 37 | looped++ | 37 | looped++ |
| @@ -57,6 +57,8 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { | |||
| 57 | class.SideMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) | 57 | class.SideMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) |
| 58 | case 7: | 58 | case 7: |
| 59 | class.UpMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) | 59 | class.UpMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) |
| 60 | case 8: | ||
| 61 | class.Buttons = utils.Read32BitsAfterFirstBitInt32(byteArr, successCount+failedCount, successCount*4+looped) | ||
| 60 | } | 62 | } |
| 61 | classIndex++ | 63 | classIndex++ |
| 62 | } else { | 64 | } else { |