From 772a1e508bb101abf2aee95238779d2b9c27f03b Mon Sep 17 00:00:00 2001 From: ulteq Date: Wed, 10 Jun 2015 16:07:09 +0200 Subject: [PATCH] Cleanup --- .../medical/functions/fnc_getTypeOfDamage.sqf | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 85d1a876ba..d51131ce0c 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -13,21 +13,23 @@ #include "script_component.hpp" -private ["_typeOfProjectile","_typeOfInjury"]; -_typeOfProjectile = _this select 0; -_typeOfInjury = switch (true) do { - case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"}; - case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"}; - case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "MineCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "FuelExplosion"): {"Explosive"}; - case (_typeOfProjectile iskindof "ShellBase"): {"Shell"}; - case (_typeOfProjectile iskindof "RocketBase"): {"Explosive"}; - case (_typeOfProjectile iskindof "MissileBase"): {"Explosive"}; - case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "BombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "Grenade"): {"Grenade"}; - default {_typeOfProjectile}; +PARAMS_1(_typeOfProjectile); + +private ["_typeOfDamage"]; + +_typeOfDamage = switch (true) do { + case (_typeOfProjectile isKindOf "BulletBase"): {"bullet"}; + case (_typeOfProjectile isKindOf "GrenadeCore"): {"grenade"}; + case (_typeOfProjectile isKindOf "TimeBombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "MineCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "FuelExplosion"): {"explosive"}; + case (_typeOfProjectile isKindOf "ShellBase"): {"shell"}; + case (_typeOfProjectile isKindOf "RocketBase"): {"explosive"}; + case (_typeOfProjectile isKindOf "MissileBase"): {"explosive"}; + case (_typeOfProjectile isKindOf "LaserBombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "BombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "Grenade"): {"grenade"}; + default {toLower _typeOfProjectile}; }; -// TODO replace the capitalization on the switch results instead.. -toLower _typeOfInjury; + +_typeOfDamage