From 438ab10ab508f9287c38f259f219cb2d9a84a405 Mon Sep 17 00:00:00 2001 From: ConnorAU Date: Sun, 17 Jan 2021 10:32:46 +1000 Subject: [PATCH] Increase DamageModifier config values to whole numbers to work around a params bug --- mission/functions/CfgParams.cpp | 4 ++-- mission/functions/eventhandlers/fn_handleDamage.sqf | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mission/functions/CfgParams.cpp b/mission/functions/CfgParams.cpp index aaf79a1..1d1e01a 100644 --- a/mission/functions/CfgParams.cpp +++ b/mission/functions/CfgParams.cpp @@ -59,8 +59,8 @@ class Params { class DamageModifier { title = "Damage modifier"; texts[] = {"0.25x","0.5x","1x","1.5x","2x","2.5x","5x","10x"}; - values[] = {0.25,0.5,1,1.5,2,2.5,5,10}; - default = 1; + values[] = {25,50,100,150,200,250,500,1000}; + default = 100; }; class KillStreak { title = "Kill streak required to advance to next weapon"; diff --git a/mission/functions/eventhandlers/fn_handleDamage.sqf b/mission/functions/eventhandlers/fn_handleDamage.sqf index 2b4707c..331c513 100644 --- a/mission/functions/eventhandlers/fn_handleDamage.sqf +++ b/mission/functions/eventhandlers/fn_handleDamage.sqf @@ -19,15 +19,15 @@ Information: params ["_unit","","_damage","","","_hitIndex","_source"]; if (_hitIndex < 0) exitWith {0}; -// Don't apply any modifier if the parameter is set to 1 (default damage) +// Don't apply any modifier if the parameter is set to 1x (default damage) private _modifier = ["get","DamageModifier"] call GG_system_fnc_params; -if (_modifier != 1) then { +if (_modifier != 100) then { private _hitPointDamage = _unit getVariable ["GG_c_hitPointDamage",[]]; if (_hitPointDamage isEqualTo []) then { _hitPointDamage = (getAllHitPointsDamage _unit # 2) apply {0}; }; - _damage = (_hitPointDamage#_hitIndex)+(_modifier*(_damage-(_hitPointDamage#_hitIndex))); + _damage = (_hitPointDamage#_hitIndex)+((_modifier*0.01)*(_damage-(_hitPointDamage#_hitIndex))); _unit setVariable ["GG_c_hitPointDamage",getAllHitPointsDamage _unit#2];