mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
made sure that the hook is released on players that doesn't exist anymore aka dead.
This commit is contained in:
parent
a91fecae92
commit
714e49b8cf
|
@ -395,7 +395,7 @@ void CHARACTER_CORE::tick(bool use_input)
|
|||
|
||||
// release hook
|
||||
hook_tick++;
|
||||
if(hooked_player != -1 && hook_tick > SERVER_TICK_SPEED*2)
|
||||
if(hooked_player != -1 && (hook_tick > SERVER_TICK_SPEED*2 || !world->characters[hooked_player]))
|
||||
{
|
||||
hooked_player = -1;
|
||||
hook_state = HOOK_RETRACTED;
|
||||
|
|
|
@ -743,6 +743,7 @@ void CHARACTER::die(int killer, int weapon)
|
|||
*/
|
||||
alive = false;
|
||||
game.world.remove_entity(this);
|
||||
game.world.core.characters[player->client_id] = 0;
|
||||
game.create_death(pos, player->client_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue