#include "../common/vehicles/all.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
+#include <common/net_linked.qh>
#include <common/weapons/_all.qh>
#include "../lib/warpzone/common.qh"
#include "../lib/warpzone/server.qh"
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;
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);
}
error("Owner lost the hook!\n");
return;
}
- if(LostMovetypeFollow(this) || intermission_running || (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;
missile.takedamage = DAMAGE_AIM;
missile.damageforcescale = 0;
missile.damagedbycontents = (autocvar_g_balance_grapplehook_damagedbycontents);
+ if(missile.damagedbycontents)
+ IL_PUSH(g_damagedbycontents, missile);
missile.hook_start = missile.hook_end = missile.origin;