X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fhook.qc;h=ff815d4619115869dff624b175e2f066a2c6b2fe;hb=0f6c4bee8db75b0aded48382af1c2693b19624de;hp=716aa247cc5160d9763c2de71a323d5bf205200a;hpb=32c0f25f733ead80f3916a52ec1726bb5d5c3588;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 716aa247c..ff815d461 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -169,6 +169,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity) gren.damageforcescale = WEP_CVAR_SEC(hook, damageforcescale); gren.event_damage = W_Hook_Damage; gren.damagedbycontents = true; + IL_PUSH(g_damagedbycontents, gren); gren.missile_flags = MIF_SPLASH | MIF_ARC; gren.velocity = '0 0 1' * WEP_CVAR_SEC(hook, speed); @@ -251,7 +252,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, { actor.ammo_fuel = 0; actor.(weaponentity).hook_state |= HOOK_REMOVING; - W_SwitchWeapon_Force(actor, w_getbestweapon(actor), weaponentity); + W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity); } } } @@ -280,27 +281,20 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, actor.(weaponentity).hook_state &= ~HOOK_REMOVING; } } -METHOD(Hook, wr_setup, void(entity thiswep, entity actor)) +METHOD(Hook, wr_setup, void(entity thiswep, entity actor, .entity weaponentity)) { - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE; - } + actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE; } -METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor)) +METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor, .entity weaponentity)) { if (!thiswep.ammo_factor) return true; - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - if(actor.(weaponentity).hook) - return actor.ammo_fuel > 0; - } + + if(actor.(weaponentity).hook) + return actor.ammo_fuel > 0; return actor.ammo_fuel >= WEP_CVAR_PRI(hook, ammo); } -METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor)) +METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor, .entity weaponentity)) { // infinite ammo for now return true; // actor.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above @@ -382,7 +376,7 @@ void Draw_GrapplingHook(entity this) InterpolateOrigin_Do(this); - int s = viewmodels[this.cnt].m_gunalign; //W_GunAlign(NULL, STAT(GUNALIGN)); + int s = W_GunAlign(viewmodels[this.cnt], STAT(GUNALIGN)) - 1; switch(this.HookType) { @@ -395,13 +389,16 @@ void Draw_GrapplingHook(entity this) break; } - if((this.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0) + if((this.owner.sv_entnum == player_localentnum - 1)) { switch(this.HookType) { default: case NET_ENT_CLIENT_HOOK: - a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; + if(autocvar_chase_active > 0) + a = csqcplayer.origin; + else + a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; b = this.origin; break; case NET_ENT_CLIENT_ARC_BEAM: