X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=2081b688dcb0f3d964bf3f1f374a80b2b993579d;hb=63ab06764e6e0a20481ab406863eb7bca32cb669;hp=a69b98487d2cbb7cb16833656178e4b369419faa;hpb=c757b2b2307fcc48ebdbf10b590142bd4d42f759;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index a69b98487..2081b688d 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -79,11 +79,11 @@ void RemoveGrapplingHooks(entity pl) for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity weaponentity = weaponentities[slot]; + if(!pl.(weaponentity)) + continue; // continue incase other slots exist? if(pl.(weaponentity).hook) - { delete(pl.(weaponentity).hook); - pl.(weaponentity).hook = NULL; - } + pl.(weaponentity).hook = NULL; } //pl.disableclientprediction = false; @@ -91,15 +91,14 @@ void RemoveGrapplingHooks(entity pl) void RemoveHook(entity this) { - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - if(this.realowner.(weaponentity).hook == this) - this.realowner.(weaponentity).hook = NULL; - } + entity player = this.realowner; + .entity weaponentity = this.weaponentity_fld; + + if(player.(weaponentity).hook == this) + player.(weaponentity).hook = NULL; - if(this.realowner.move_movetype == MOVETYPE_FLY) - set_movetype(this.realowner, MOVETYPE_WALK); + if(player.move_movetype == MOVETYPE_FLY) + set_movetype(player, MOVETYPE_WALK); delete(this); } @@ -163,7 +162,7 @@ void GrapplingHookThink(entity this) error("Owner lost the hook!\n"); return; } - if(LostMovetypeFollow(this) || gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) + if(LostMovetypeFollow(this) || game_stopped || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) { RemoveHook(this); return;