mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
changed chatmsgs to use time instead of ticks
This commit is contained in:
parent
01d74a6d4d
commit
b28ede2da2
|
@ -14,7 +14,7 @@ void CHAT::on_reset()
|
||||||
{
|
{
|
||||||
mode = MODE_NONE;
|
mode = MODE_NONE;
|
||||||
for(int i = 0; i < MAX_LINES; i++)
|
for(int i = 0; i < MAX_LINES; i++)
|
||||||
lines[i].tick = -1000000;
|
lines[i].time = -1000000;
|
||||||
current_line = 0;
|
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)
|
void CHAT::add_line(int client_id, int team, const char *line)
|
||||||
{
|
{
|
||||||
current_line = (current_line+1)%MAX_LINES;
|
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].client_id = client_id;
|
||||||
lines[current_line].team = team;
|
lines[current_line].team = team;
|
||||||
lines[current_line].name_color = -2;
|
lines[current_line].name_color = -2;
|
||||||
|
@ -158,7 +158,7 @@ void CHAT::on_render()
|
||||||
for(i = 0; i < MAX_LINES; i++)
|
for(i = 0; i < MAX_LINES; i++)
|
||||||
{
|
{
|
||||||
int r = ((current_line-i)+MAX_LINES)%MAX_LINES;
|
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;
|
break;
|
||||||
|
|
||||||
float begin = x;
|
float begin = x;
|
||||||
|
|
|
@ -12,7 +12,7 @@ class CHAT : public COMPONENT
|
||||||
|
|
||||||
struct LINE
|
struct LINE
|
||||||
{
|
{
|
||||||
int tick;
|
int64 time;
|
||||||
int client_id;
|
int client_id;
|
||||||
int team;
|
int team;
|
||||||
int name_color;
|
int name_color;
|
||||||
|
|
Loading…
Reference in a new issue