From 714e49b8cf5679faef0abe945014d6d260ceb643 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Fri, 17 Oct 2008 21:42:32 +0000 Subject: made sure that the hook is released on players that doesn't exist anymore aka dead. --- src/game/gamecore.cpp | 2 +- src/game/server/entities/character.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index c4a3392b..ccef8de8 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -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; diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 4ef7cc78..2ba27214 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -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); } -- cgit 1.4.1