Skip to content

Commit

Permalink
Increase DamageModifier config values to whole numbers to work around…
Browse files Browse the repository at this point in the history
… a params bug
  • Loading branch information
ConnorAU committed Jan 17, 2021
1 parent 6b88555 commit 438ab10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mission/functions/CfgParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions mission/functions/eventhandlers/fn_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 438ab10

Please sign in to comment.