X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=b2b91bc02baf71cea1adf089e8236eea2a397667;hp=d482f092d8db8df81741f08e5b8a770bbc0ce32f;hb=e0012447bfce1b551df3dc01b043655aa93dafad;hpb=a8e11f490f08342fc48c332412c8fc6e23f3d171 diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index d482f092d..b2b91bc02 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -21,8 +21,6 @@ #include "../lib/warpzone/common.qh" #include "../lib/warpzone/server.qh" -.int state; - /*============================================ Wazat's Xonotic Grappling Hook @@ -72,8 +70,6 @@ And you should be done! ============================================*/ -.float hook_length; - void RemoveGrapplingHooks(entity pl) { if(pl.move_movetype == MOVETYPE_FLY) @@ -328,7 +324,6 @@ void GrapplingHookTouch(entity this, entity toucher) if(toucher) //if(toucher.move_movetype != MOVETYPE_NONE) - if(!(toucher.flags & FL_PROJECTILE) || toucher.classname == "nade") { SetMovetypeFollow(this, toucher); WarpZone_RefSys_BeginAddingIncrementally(this, this.aiment); @@ -339,15 +334,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(GetResourceAmount(this, RESOURCE_HEALTH) <= 0) + if(GetResource(this, RES_HEALTH) <= 0) return; if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions return; // g_balance_projectiledamage says to halt - TakeResource(this, RESOURCE_HEALTH, damage); + TakeResource(this, RES_HEALTH, damage); - if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0) + if (GetResource(this, RES_HEALTH) <= 0) { if(attacker != this.realowner) { @@ -361,7 +356,7 @@ void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float void FireGrapplingHook(entity actor, .entity weaponentity) { - if(forbidWeaponUse(actor)) return; + if(weaponLocked(actor)) return; if(actor.vehicle) return; // TODO: offhand hook shoots from eye @@ -398,7 +393,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity) missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION; - SetResourceAmountExplicit(missile, RESOURCE_HEALTH, autocvar_g_balance_grapplehook_health); + SetResourceExplicit(missile, RES_HEALTH, autocvar_g_balance_grapplehook_health); missile.event_damage = GrapplingHook_Damage; missile.takedamage = DAMAGE_AIM; missile.damageforcescale = 0;