From 18298d266cea088f777a59ef94ec8fafdd78d339 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Tue, 25 Jul 2023 21:40:30 +0100 Subject: Fix Arc Cannon not dealing damage when used by NPCs (#666) Fixes NPCs using mp_titanweapon_arc_cannon not dealing damage to other entities --- Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Northstar.Custom/mod/scripts/vscripts/weapons') diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut index cd58ef06..01138967 100644 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut +++ b/Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut @@ -552,12 +552,16 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 ) int damageNearValue = eWeaponVar.damage_near_value int damageFarValueTitanArmor = eWeaponVar.damage_far_value_titanarmor int damageNearValueTitanArmor = eWeaponVar.damage_near_value_titanarmor + int damageFarDistance = eWeaponVar.damage_far_distance + int damageNearDistance = eWeaponVar.damage_near_distance if ( zapInfo.player.IsNPC() ) { damageFarValue = eWeaponVar.npc_damage_far_value damageNearValue = eWeaponVar.npc_damage_near_value damageFarValueTitanArmor = eWeaponVar.npc_damage_far_value_titanarmor damageNearValueTitanArmor = eWeaponVar.npc_damage_near_value_titanarmor + damageFarDistance = eWeaponVar.npc_damage_far_distance + damageNearDistance = eWeaponVar.npc_damage_near_distance } if ( IsValid( target ) && IsValid( zapInfo.player ) ) @@ -613,8 +617,8 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 ) { // use distance for damage if the weapon auto-fires entity weapon = expect entity( zapInfo.weapon ) - float nearDist = weapon.GetWeaponSettingFloat( eWeaponVar.damage_near_distance ) - float farDist = weapon.GetWeaponSettingFloat( eWeaponVar.damage_far_distance ) + float nearDist = weapon.GetWeaponSettingFloat( damageNearDistance ) + float farDist = weapon.GetWeaponSettingFloat( damageFarDistance ) float dist = Distance( weapon.GetOrigin(), target.GetOrigin() ) damageAmount = GraphCapped( dist, farDist, nearDist, damageMin, damageMax ) @@ -1044,4 +1048,4 @@ function GetWeaponChargeFrac( weapon ) if ( weapon.IsChargeWeapon() ) return weapon.GetWeaponChargeFraction() return 1.0 -} \ No newline at end of file +} -- cgit v1.2.3