X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=68aa7154ecdc3928261ea584bd251be2c86d2c03;hb=4b1bbe437c643e20de07b3bebc8328ed06830b99;hp=ef31dd4ec0bfaeb06ad8dd64c63870b705c71299;hpb=4c659ff902dd85a9eceb9e2af9e3e8121985a230;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index ef31dd4ec..68aa7154e 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -338,15 +338,15 @@ void GrapplingHookTouch(entity this, entity toucher) void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { - if(this.health <= 0) + if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0) return; if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions return; // g_balance_projectiledamage says to halt - this.health = this.health - damage; + TakeResource(this, RESOURCE_HEALTH, damage); - if (this.health <= 0) + if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0) { if(attacker != this.realowner) { @@ -397,7 +397,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity) missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION; - missile.health = autocvar_g_balance_grapplehook_health;//120 + SetResourceAmountExplicit(missile, RESOURCE_HEALTH, autocvar_g_balance_grapplehook_health); missile.event_damage = GrapplingHook_Damage; missile.takedamage = DAMAGE_AIM; missile.damageforcescale = 0;