Merge remote-tracking branch 'refs/remotes/acemod/master'

This commit is contained in:
Jonathan Pereira 2015-10-26 21:09:28 -02:00
commit f6dbf9ab42
5 changed files with 18 additions and 16 deletions

View File

@ -154,13 +154,13 @@ class ACE_Settings {
category = CSTRING(Category_Medical);
typeName = "SCALAR";
value = 3;
values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"};
values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)};
};
class GVAR(useLocation_SurgicalKit) {
category = CSTRING(Category_Medical);
typeName = "SCALAR";
value = 2;
values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"};
values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)};
};
class GVAR(useCondition_PAK) {
category = CSTRING(Category_Medical);

View File

@ -11,6 +11,9 @@
* ReturnValue:
* Can Treat <BOOL>
*
* Example:
* [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat
*
* Public: Yes
*/
@ -85,10 +88,11 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI
_val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then {
_return = switch (_val) do {
case 0: {true};
case 1: _medVeh;
case 2: _medFacility;
case 3: {call _medFacility || call _medVeh};
case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle
case 2: {call _medFacility}; //AdvancedMedicalSettings_facility
case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility
default {false}; //Disabled
};
};
};

View File

@ -100,10 +100,11 @@ if ("All" in _locations) then {
_val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then {
_return = switch (_val) do {
case 0: {true};
case 1: _medVeh;
case 2: _medFacility;
case 3: {call _medFacility || call _medVeh};
case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle
case 2: {call _medFacility}; //AdvancedMedicalSettings_facility
case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility
default {false}; //Disabled
};
};
};

View File

@ -15,9 +15,7 @@
*/
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0;
params ["_unit"];
(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN", 0, true];
if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {};
@ -27,7 +25,7 @@ GVAR(AltimeterActive) = true;
[{
if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler)};
disableSerialization;
EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime);
(_this select 0) params ["_display", "_unit", "_oldHeight", "_prevTime"];
if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)};
private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime", "_timeDiff"];
@ -38,7 +36,7 @@ GVAR(AltimeterActive) = true;
_hour = floor daytime;
_minute = floor ((daytime - _hour) * 60);
_height = (getPosASL _unit) select 2;
_height = ((getPosASL _unit) select 2) + EGVAR(common,mapAltitude);
_curTime = ACE_time;
_timeDiff = _curTime - _prevTime;
_descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0};

View File

@ -1,4 +1,3 @@
#define DEBUG_ENABLED_PARACHUTE
#define COMPONENT parachute
#include "\z\ace\addons\main\script_mod.hpp"