diff options
| author | Alfred Eriksson <somerunce@gmail.com> | 2009-01-24 16:09:20 +0000 |
|---|---|---|
| committer | Alfred Eriksson <somerunce@gmail.com> | 2009-01-24 16:09:20 +0000 |
| commit | b28ede2da2c42643c5aa710a8076f0249d48c9e4 (patch) | |
| tree | 3ca0d0acf9bc9100569777b2b111e311c8cc2867 /src | |
| parent | 01d74a6d4d23454e50dedad4572fbf8dad80f34d (diff) | |
| download | zcatch-b28ede2da2c42643c5aa710a8076f0249d48c9e4.tar.gz zcatch-b28ede2da2c42643c5aa710a8076f0249d48c9e4.zip | |
changed chatmsgs to use time instead of ticks
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/client/components/chat.cpp | 6 | ||||
| -rw-r--r-- | src/game/client/components/chat.hpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 64efd531..01b9f457 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -14,7 +14,7 @@ void CHAT::on_reset() { mode = MODE_NONE; for(int i = 0; i < MAX_LINES; i++) - lines[i].tick = -1000000; + lines[i].time = -1000000; current_line = 0; } @@ -97,7 +97,7 @@ void CHAT::on_message(int msgtype, void *rawmsg) void CHAT::add_line(int client_id, int team, const char *line) { current_line = (current_line+1)%MAX_LINES; - lines[current_line].tick = client_tick(); + lines[current_line].time = time_get(); lines[current_line].client_id = client_id; lines[current_line].team = team; lines[current_line].name_color = -2; @@ -158,7 +158,7 @@ void CHAT::on_render() for(i = 0; i < MAX_LINES; i++) { int r = ((current_line-i)+MAX_LINES)%MAX_LINES; - if(client_tick() > lines[r].tick+50*15) + if(time_get() > lines[r].time+15*time_freq()) break; float begin = x; diff --git a/src/game/client/components/chat.hpp b/src/game/client/components/chat.hpp index 211b3085..593ef87e 100644 --- a/src/game/client/components/chat.hpp +++ b/src/game/client/components/chat.hpp @@ -12,7 +12,7 @@ class CHAT : public COMPONENT struct LINE { - int tick; + int64 time; int client_id; int team; int name_color; |