mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added delay before respawn when using the kill-command; provided and tested by scosu; ticket #463
This commit is contained in:
parent
a4e922cf5a
commit
eb47aa385b
|
@ -315,7 +315,7 @@ void mods_message(int msgtype, int client_id)
|
|||
return;
|
||||
|
||||
p->last_kill = time_get();
|
||||
|
||||
p->respawn_tick = server_tick()+server_tickspeed()*3;
|
||||
p->kill_character(); //(client_id, -1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ MACRO_ALLOC_POOL_ID_IMPL(PLAYER, MAX_CLIENTS)
|
|||
|
||||
PLAYER::PLAYER(int client_id)
|
||||
{
|
||||
respawn_tick = server_tick();
|
||||
character = 0;
|
||||
this->client_id = client_id;
|
||||
}
|
||||
|
@ -56,7 +57,7 @@ void PLAYER::tick()
|
|||
character = 0;
|
||||
}
|
||||
}
|
||||
else if(spawning)
|
||||
else if(spawning && respawn_tick <= server_tick())
|
||||
try_respawn();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
int color_body;
|
||||
int color_feet;
|
||||
|
||||
int respawn_tick;
|
||||
//
|
||||
bool spawning;
|
||||
int client_id;
|
||||
|
|
Loading…
Reference in a new issue