diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2007-08-10 11:55:59 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2007-08-10 11:55:59 +0000 |
| commit | dd7d97663e820429c1a4fd0ab96311a64a709700 (patch) | |
| tree | 6e2b37a914511790f2bc67d8014dbbcf5f65c53b | |
| parent | 20ede630888e93bbae48427efd9478388f58d4ac (diff) | |
| download | zcatch-dd7d97663e820429c1a4fd0ab96311a64a709700.tar.gz zcatch-dd7d97663e820429c1a4fd0ab96311a64a709700.zip | |
blinks now use last action as an offset, so all tees has their own rate pretty much
| -rw-r--r-- | src/game/server/game_server.cpp | 8 | ||||
| -rw-r--r-- | src/game/server/game_server.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp index a28719c7..f6dfccd8 100644 --- a/src/game/server/game_server.cpp +++ b/src/game/server/game_server.cpp @@ -750,6 +750,7 @@ void player::reset() die_tick = 0; damage_taken = 0; state = STATE_UNKNOWN; + last_action = -1; } void player::destroy() { } @@ -1494,9 +1495,9 @@ void player::snap(int snaping_client) //if(damage_taken_tick+50 > server_tick()) // player->emote = EMOTE_PAIN; - if(player->emote == EMOTE_NORMAL) + if (player->emote == EMOTE_NORMAL) { - if((server_tick()%(50*5)) < 5) + if(250 - ((server_tick() - last_action)%(250)) < 5) player->emote = EMOTE_BLINK; } @@ -1894,6 +1895,9 @@ void mods_client_input(int client_id, void *input) { if(!world.paused) { + if (memcmp(&players[client_id].input, input, sizeof(player_input)) != 0) + players[client_id].last_action = server_tick(); + //players[client_id].previnput = players[client_id].input; players[client_id].input = *(player_input*)input; } diff --git a/src/game/server/game_server.h b/src/game/server/game_server.h index 91727b06..83824f0a 100644 --- a/src/game/server/game_server.h +++ b/src/game/server/game_server.h @@ -221,6 +221,8 @@ public: int emote_type; int emote_stop; + + int last_action; // we need a defered position so we can handle the physics correctly baselib::vec2 defered_pos; |