Merge remote-tracking branch 'origin/master' into medical-rewrite

This commit is contained in:
commy2 2016-09-30 21:19:16 +02:00
commit a54aec72bc
15 changed files with 38 additions and 21 deletions

View File

@ -28,7 +28,7 @@ private _whitespaceList = [];
{
if (_removeWhitespace) then {
_whitespaceList pushBack ([_x] call FUNC(stringRemoveWhiteSpace));
_whitespaceList pushBack ([_x] call CBA_fnc_removeWhitespace);
} else {
_whitespaceList pushBack ([_x] call CBA_fnc_trim);
};

View File

@ -17,4 +17,6 @@
params ["_string"];
ACE_DEPRECATED(QFUNC(stringRemoveWhiteSpace),"3.10.0","CBA_fnc_removeWhitespace");
(_string splitString " ") joinString ""

View File

@ -20,7 +20,9 @@ params ["_vehicle"];
if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {};
_vehicle setVariable [QGVAR(isCookingOff), true];
[QGVAR(cookOff), _vehicle] call CBA_fnc_remoteEvent;
if (local _vehicle) then {
[QGVAR(cookOff), _vehicle] call CBA_fnc_remoteEvent;
};
[{
params ["_vehicle"];

View File

@ -4,7 +4,7 @@
scope = 1; \
scopeArsenal = 0; \
scopeCurator = 0; \
descriptionShort = QUOTE(DOGTAGID); \
descriptionShort = CSTRING(itemName); \
GVAR(tagID) = DOGTAGID; \
}

View File

@ -42,7 +42,7 @@ if(_zIndex < 5) then {
_lastPos = _testPos;
};
};
_params set[4, _zIndex+1];
_args set[4, _zIndex+1];
} else {
_depth = _depth + 1;
_buckets = [];

View File

@ -13,7 +13,7 @@
// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 1.62
#define REQUIRED_CBA_VERSION {3,0,0}
#define REQUIRED_CBA_VERSION {3,1,0}
#ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED)

View File

@ -0,0 +1,11 @@
ace_medical_blood
===============
Adds blood visual effect on the ground near a bleeding player.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [Glowbal](https://github.com/Glowbal)
- [commy2](https://github.com/commy2)

View File

@ -25,8 +25,17 @@ if (isServer) then {
["ace_settingsInitialized", {
TRACE_1("settingsInitialized", GVAR(enabledFor));
if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled
if ((GVAR(enabledFor) == 1) && {!hasInterface}) exitWith {}; // 1: enabledFor_OnlyPlayers
private _listcode = if (GVAR(enabledFor) == 1) then {
{[ACE_player] select {[_x] call FUNC(isBleeding)}} // ace_player is only possible local player
} else {
{allUnits select {(local _x) && {[_x] call FUNC(isBleeding)}}}; // filter all local bleeding units
};
private _stateMachine = [_listcode, true] call CBA_statemachine_fnc_create;
[_stateMachine, {call FUNC(onBleeding)}, {}, {}, "Bleeding"] call CBA_statemachine_fnc_addState;
[configFile >> QGVAR(stateMachine)] call CBA_statemachine_fnc_createFromConfig;
["CAManBase", "hit", {
params ["_unit"];

View File

@ -14,5 +14,5 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "state_machine.hpp"

View File

@ -19,6 +19,7 @@
#include "script_component.hpp"
params ["_type", "_pos"];
TRACE_2("creating blood",_type,_pos);
private _model = GVAR(models) getVariable _type;

View File

@ -16,14 +16,13 @@
params ["_unit", "_causedBy", "_damage"];
if (((vehicle _unit) != _unit) && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted
if (isNull _causedBy) exitWith { // won't be able to calculate the direction properly, so instead we pick something at random
[QGVAR(spurt), [_unit, random 360, _damage]] call CBA_fnc_serverEvent;
};
// Calculate bulletDirection
private _unitPos = getPosASL _unit;
private _causedByPos = getPosASL _causedBy;
private _bulletDir = ((_unitPos select 0) - (_causedByPos select 0)) atan2 ((_unitPos select 1) - (_causedByPos select 1));
private _bulletDir = _unit getDir _causedBy;
[QGVAR(spurt), [_unit, _bulletDir, _damage]] call CBA_fnc_serverEvent;

View File

@ -17,7 +17,7 @@
params ["_unit"];
if (GVAR(enabledFor) == 1 && {!isPlayer _unit || {_unit == ACE_player}}) exitWith {};
if (((vehicle _unit) != _unit) && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted
private _lastTime = _unit getVariable [QGVAR(lastTime), -10];
private _bloodLoss = (if (GVAR(useAceMedical)) then {([_unit] call EFUNC(medical,getBloodLoss)) * 2.5} else {getDammage _unit * 2}) min 6;

View File

@ -1,7 +0,0 @@
class GVAR(stateMachine) {
list = QUOTE(allUnits select {[_x] call FUNC(isBleeding)});
skipNull = 1;
class Bleeding {
onState = QUOTE(call FUNC(onBleeding));
};
};

View File

@ -36,7 +36,7 @@ if (_activated && local _logic) then {
_missionRoot = str missionConfigFile select [0, count str missionConfigFile - 15];
{
_x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
_x = [_x] call CBA_fnc_removeWhitespace;
if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then {
// CfgSounds accepts a leading backslash, but a double backslash

View File

@ -47,7 +47,7 @@ if (_textures isEqualTo []) exitWith {
ACE_LOGERROR_1("Failed adding custom tag: %1 - missing textures",_identifier);
};
_identifier = [_identifier] call EFUNC(common,stringRemoveWhiteSpace);
_identifier = [_identifier] call CBA_fnc_removeWhitespace;
_requiredItem = toLower _requiredItem;
// Add