Code Cleanup Medical Module (Part 3).

This commit is contained in:
jokoho48 2015-08-22 18:33:06 +02:00
parent 10127ed957
commit ff6c8a31be
10 changed files with 25 additions and 20 deletions

View File

@ -13,5 +13,5 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_caller", "_target"];
[_this, QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -17,9 +17,10 @@
private ["_bloodPressure", "_logOutPut", "_output"]; private ["_bloodPressure", "_logOutPut", "_output"];
params ["_caller", "_target"]; params ["_caller", "_target"];
_bloodPressure = [_target] call FUNC(getBloodPressure); _bloodPressure = if (!alive _target) then {
if (!alive _target) then { [0,0]
_bloodPressure = [0,0]; } else {
[_target] call FUNC(getBloodPressure)
}; };
_bloodPressure params ["_bloodPressureLow", "_bloodPressureLow"]; _bloodPressure params ["_bloodPressureLow", "_bloodPressureLow"];
_output = ""; _output = "";

View File

@ -13,5 +13,5 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_caller","_target"];
[_this, QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -18,14 +18,13 @@ private "_vehicle";
params ["_caller", "_target"]; params ["_caller", "_target"];
if ([_target] call EFUNC(common,isAwake)) exitwith { if ([_target] call EFUNC(common,isAwake)) exitwith {
// TODO localization ["displayTextStructured", [_caller], [[localize LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
}; };
if ([_target] call FUNC(isBeingCarried)) then { if ([_target] call FUNC(isBeingCarried)) then {
_this call EFUNC(dragging,dropObject_carry); ["_caller", "_target"] call EFUNC(dragging,dropObject_carry);
}; };
if ([_target] call FUNC(isBeingDragged)) then { if ([_target] call FUNC(isBeingDragged)) then {
_this call EFUNC(dragging,dropObject); ["_caller", "_target"] call EFUNC(dragging,dropObject);
}; };
_vehicle = _this call EFUNC(common,loadPerson); _vehicle = ["_caller", "_target"] call EFUNC(common,loadPerson);

View File

@ -24,7 +24,7 @@ _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart // Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith { if ((_tourniquets select _part) == 0) exitwith {
_output = "There is no tourniquet on this body part!"; _output = localize LSTRING(noTourniquetOnBodyPart);
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
}; };

View File

@ -17,13 +17,13 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; private ["_moment", "_logVarName", "_log","_newLog", "_logs"];
params ["_unit", "_type", "_allMapMarkers", "_arguments"]; params ["_unit", "_type", "_message", "_arguments"];
if (!local _unit) exitwith { if (!local _unit) exitwith {
[_this, QUOTE(DFUNC(addToLog)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
date params ["_minute", "_hour"]; date params ["", "", "", "_minute", "_hour"];
_moment = if (_minute < 10) then { _moment = if (_minute < 10) then {
format["%1:0%2", _hour, _minute] format["%1:0%2", _hour, _minute]

View File

@ -27,7 +27,7 @@ _actions = [];
str(_unit), str(_unit),
[_unit, true] call EFUNC(common,getName), [_unit, true] call EFUNC(common,getName),
"", "",
{[_player, _parameters select 0] call FUNC(actionUnloadUnit);}, {[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);},
{true}, {true},
{}, {},
[_unit] [_unit]

View File

@ -28,4 +28,4 @@ call {
if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"};
if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"};
toLower _typeOfProjectile toLower _typeOfProjectile
}; }

View File

@ -75,7 +75,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t
[{ [{
private ["_args", "_params"]; private ["_args", "_params"];
params ["_args", "_idPFH"]; params ["_args", "_idPFH"];
params ["_unit", "_frameno"]; _args params ["_unit", "_frameno"];
if (diag_frameno > _frameno + 2) then { if (diag_frameno > _frameno + 2) then {
_unit setDamage 0; _unit setDamage 0;

View File

@ -3617,5 +3617,10 @@
<English>Distance to %1 has become to far for treatment</English> <English>Distance to %1 has become to far for treatment</English>
<Polish>%1 odszedł zbyt daleko, nie można kontynuować leczenia</Polish> <Polish>%1 odszedł zbyt daleko, nie można kontynuować leczenia</Polish>
</Key> </Key>
<Key ID="STR_ACE_Medical_CanNotLoaded">
<English>This person (%1) is awake and cannot be loaded</English>
</Key>
<Key ID="STR_ACE_Medical_noTourniquetOnBodyPart">
<English>There is no tourniquet on this body part!</English>
</Package> </Package>
</Project> </Project>