(usercmd_t cmd)
| 298 | * ============== CL_FinishMove ============== |
| 299 | */ |
| 300 | private static void FinishMove(usercmd_t cmd) { |
| 301 | int ms; |
| 302 | int i; |
| 303 | |
| 304 | // |
| 305 | // figure button bits |
| 306 | // |
| 307 | if ((in_attack.state & 3) != 0) |
| 308 | cmd.buttons |= Defines.BUTTON_ATTACK; |
| 309 | in_attack.state &= ~2; |
| 310 | |
| 311 | if ((in_use.state & 3) != 0) |
| 312 | cmd.buttons |= Defines.BUTTON_USE; |
| 313 | in_use.state &= ~2; |
| 314 | |
| 315 | if (Key.anykeydown != 0 && ClientGlobals.cls.key_dest == Defines.key_game) |
| 316 | cmd.buttons |= Defines.BUTTON_ANY; |
| 317 | |
| 318 | // send milliseconds of time to apply the move |
| 319 | ms = (int) (ClientGlobals.cls.frametime * 1000); |
| 320 | if (ms > 250) |
| 321 | ms = 100; // time was unreasonable |
| 322 | cmd.msec = (byte) ms; |
| 323 | |
| 324 | ClampPitch(); |
| 325 | for (i = 0; i < 3; i++) |
| 326 | cmd.angles[i] = (short) Math3D.ANGLE2SHORT(ClientGlobals.cl.viewangles[i]); |
| 327 | |
| 328 | cmd.impulse = (byte) in_impulse; |
| 329 | in_impulse = 0; |
| 330 | |
| 331 | // send the ambient light level at the player's current position |
| 332 | cmd.lightlevel = (byte) ClientGlobals.cl_lightlevel.value; |
| 333 | } |
| 334 | |
| 335 | /* |
| 336 | * ================= CL_CreateCmd ================= |
no test coverage detected