made sure that the hook is released on players that doesn't exist anymore aka dead.

This commit is contained in:
Magnus Auvinen 2008-10-17 21:42:32 +00:00
parent a91fecae92
commit 714e49b8cf
2 changed files with 2 additions and 1 deletions

View file

@ -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;

View file

@ -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);
}