diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-12-09 16:10:12 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-12-09 16:10:12 +0000 |
| commit | d689bd3c836a3d1b78c4a7a87c1bd01ff3f7664f (patch) | |
| tree | 00b5b900141da102227b20b173ffc655077d250a | |
| parent | 7f95a8d4a69640ad7c38fe743a08e637b97b034c (diff) | |
| download | zcatch-d689bd3c836a3d1b78c4a7a87c1bd01ff3f7664f.tar.gz zcatch-d689bd3c836a3d1b78c4a7a87c1bd01ff3f7664f.zip | |
fixed the initial input crappiness that makes a bullet fire when the map is restarted
| -rw-r--r-- | src/game/server/game_server.cpp | 7 | ||||
| -rw-r--r-- | src/game/server/srv_common.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp index eba15f2b..ebd5dff3 100644 --- a/src/game/server/game_server.cpp +++ b/src/game/server/game_server.cpp @@ -383,6 +383,7 @@ void player::reset() mem_zero(&input, sizeof(input)); mem_zero(&previnput, sizeof(previnput)); + num_inputs = 0; last_action = -1; @@ -913,6 +914,11 @@ int player::handle_weapons() void player::tick() { + // check if we have enough input + // this is to prevent initial weird clicks + if(num_inputs < 2) + previnput = input; + // do latency stuff { CLIENT_INFO info; @@ -1540,6 +1546,7 @@ void mods_client_input(int client_id, void *input) //players[client_id].previnput = players[client_id].input; players[client_id].input = *(player_input*)input; + players[client_id].num_inputs++; } } diff --git a/src/game/server/srv_common.h b/src/game/server/srv_common.h index 16c78d3f..80a5260b 100644 --- a/src/game/server/srv_common.h +++ b/src/game/server/srv_common.h @@ -260,6 +260,7 @@ public: // input player_input previnput; player_input input; + int num_inputs; int jumped; int damage_taken_tick; |