Merge branch 'master' into repair

This commit is contained in:
Glowbal 2015-08-11 21:09:44 +02:00
commit 660f8debf6
16 changed files with 67 additions and 77 deletions

View File

@ -1,27 +1,21 @@
<p align="center">
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg"
height="112">
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
</p>
<p align="center">
<a href="https://github.com/acemod/ACE3/releases">
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg"
alt="ACE version">
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg" alt="ACE3 version">
</a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.2.1/ace3_3.2.1.zip">
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg"
alt="ACE download">
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" alt="ACE3 download">
</a>
<a href="https://github.com/acemod/ACE3/issues">
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues"
alt="ACE issues">
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 issues">
</a>
<a href="http://forums.bistudio.com/showthread.php?191716-ACE3-A-collaborative-merger-between-AGM-CSE-and-ACE&p=2935435&viewfull=1#post2935435">
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg"
alt="BIF thread">
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg" alt="BIF thread">
</a>
<a href="https://github.com/acemod/ACE3/blob/master/LICENSE">
<img src="http://img.shields.io/badge/License-GPLv2-red.svg"
alt="ACE license">
<img src="http://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 license">
</a>
</p>
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a>. Visit us on <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup></p>

View File

@ -5,6 +5,7 @@ if (!hasInterface) exitWith {};
["inventoryDisplayLoaded", {[ACE_player, _this select 0] call FUNC(updateInventoryDisplay)}] call EFUNC(common,addEventHandler);
["playerInventoryChanged", {
[_this select 0, _this select 1 select 11] call FUNC(takeLoadedATWeapon);
[_this select 0] call FUNC(updateInventoryDisplay);
params ["_unit", "_items"];
[_unit, _items select 11] call FUNC(takeLoadedATWeapon);
[_unit] call FUNC(updateInventoryDisplay);
}] call EFUNC(common,addEventHandler);

View File

@ -21,11 +21,8 @@
*/
#include "script_component.hpp"
private ["_unit", "_weapon", "_projectile", "_replacementTube", "_items"];
_unit = _this select 0;
_weapon = _this select 1;
_projectile = _this select 6;
private ["_replacementTube", "_items"];
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
if (!local _unit) exitWith {};
@ -43,19 +40,19 @@ _unit selectWeapon _replacementTube;
//Re-add all attachments to the used tube
{
if (_x != "") then {_unit addSecondaryWeaponItem _x};
} forEach _items;
} count _items;
// AI - Remove the ai's missle launcher tube after the missle has exploded
if !([_unit] call EFUNC(common,isPlayer)) then {
[{
EXPLODE_2_PVT(_this,_params,_pfhId);
EXPLODE_3_PVT(_params,_unit,_tube,_projectile);
params ["_args","_idPFH"];
_args params ["_unit", "_tube", "_projectile"];
//don't do anything until projectile is null (exploded/max range)
if (isNull _projectile) then {
//Remove PFEH:
[_pfhId] call cba_fnc_removePerFrameHandler;
[_idPFH] call cba_fnc_removePerFrameHandler;
//If (tube is dropped) OR (is dead) OR (is player) just exit
if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {};
@ -66,13 +63,13 @@ if !([_unit] call EFUNC(common,isPlayer)) then {
_container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"];
_container setPosAsl (getPosAsl _unit);
_container addWeaponCargoGlobal [_tube, 1];
//This will duplicate attachements, because we will be adding a weapon that may already have attachments on it
//We either need a way to add a clean weapon, or a way to add a fully configured weapon to a container:
// {
// if (_x != "") then {_container addItemCargoGlobal [_x, 1];};
// } forEach _items;
_unit removeWeaponGlobal _tube;
};
}, 1, [_unit, _replacementTube, _projectile]] call CBA_fnc_addPerFrameHandler;

View File

@ -17,7 +17,8 @@
private ["_unit", "_launcher", "_config"];
PARAMS_1(_unit);
params ["_unit"];
if (!local _unit) exitWith {};
_launcher = secondaryWeapon _unit;

View File

@ -16,9 +16,7 @@
#include "script_component.hpp"
disableSerialization;
PARAMS_1(_player);
DEFAULT_PARAM(1,_display,(findDisplay 602));
params ["_player", ["_display",(findDisplay 602),[displayNull]]];
_player removeMagazines "ACE_PreloadedMissileDummy";
_player removeMagazines "ACE_FiredMissileDummy";

View File

@ -29,10 +29,10 @@ _items = _this select 4;
{
if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard);
[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
};
}foreach _items;
[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); // TODO expand message
true;

View File

@ -44,7 +44,7 @@ _removeItem = _items select 0;
[_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
true;

View File

@ -24,24 +24,22 @@ _selectionN = GVAR(selectedBodyPart);
if (_selectionN < 0 || _selectionN > 5) exitwith {};
_genericMessages = [];
if (EGVAR(medical,level) >= 2) then {
_partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN;
_genericMessages pushBack [localize _partText, [1, 1, 1, 1]];
};
_partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN;
_genericMessages pushBack [localize _partText, [1, 1, 1, 1]];
if (_target getVariable [QGVAR(isBleeding), false]) then {
if (_target getVariable [QEGVAR(medical,isBleeding), false]) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]];
};
if (_target getVariable [QGVAR(hasLostBlood), 0] > 1) then {
if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
};
if (((_target getVariable [QGVAR(tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then {
if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]];
};
if (_target getVariable [QGVAR(hasPain), false]) then {
if (_target getVariable [QEGVAR(medical,hasPain), false]) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Pain), [1, 1, 1, 1]];
};
@ -52,7 +50,7 @@ _totalIvVolume = 0;
if (!isNil "_value") then {
_totalIvVolume = _totalIvVolume + (_target getVariable [_x, 0]);
};
} count GVAR(IVBags);
} count EGVAR(medical,IVBags);
if (_totalIvVolume >= 1) then {
_genericMessages pushBack [format [localize ELSTRING(medical,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]];

View File

@ -6,10 +6,10 @@
* None
*
* Return Value:
* can deploy? <BOOLEAN>
* Can deploy <BOOL>
*
* Example:
* call ace_sandbag_fnc_canDeploy;
* [] call ace_sandbag_fnc_canDeploy
*
* Public: No
*/
@ -22,6 +22,7 @@ if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false };
if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false };
private ["_surfaceClass", "_surfaceType"];
_surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1;
_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");

View File

@ -10,39 +10,39 @@
* None
*
* Example:
* [_sandbag, _unit] call ace_sandbag_fnc_carry;
* [_sandbag, _unit] call ace_sandbag_fnc_carry
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_sandbag,_unit);
params ["_sandbag", "_unit"];
_unit playActionNow "PutDown";
_unit setVariable [QGVAR(usingSandbag), true];
[{
PARAMS_2(_sandbag,_unit);
params ["_sandbag", "_unit"];
GVAR(carrier) = ACE_player;
[GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
deleteVehicle _sandbag;
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"];
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
GVAR(sandBag) enableSimulationGlobal false;
// Force physx update
{
_x setPosASL (getPosASL _x);
} forEach (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]);
} count (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]);
GVAR(carryPFH) = [{
if (GVAR(carrier) != ACE_player) exitWith {
call FUNC(drop);
};
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
}, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* call ace_sandbag_fnc_deploy;
* [] call ace_sandbag_fnc_deploy
*
* Public: No
*/
@ -21,14 +21,14 @@ GVAR(placer) = ACE_player;
[GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"];
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
GVAR(sandBag) enableSimulationGlobal false;
GVAR(deployPFH) = [{
if (GVAR(placer) != ACE_player) exitWith {
call FUNC(deployCancel);
};
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
}, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* call ace_sandbag_fnc_deployCancel;
* [] call ace_sandbag_fnc_deployCancel
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* call ace_sandbag_fnc_deployConfirm;
* [] call ace_sandbag_fnc_deployConfirm
*
* Public: No
*/
@ -36,16 +36,16 @@ GVAR(placer) setVariable [QGVAR(usingSandbag), true];
private ["_sandBag", "_position", "_direction"];
_position = getPosASL GVAR(sandBag);
_direction = getDir GVAR(sandBag);
deleteVehicle GVAR(sandBag);
_sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"];
_sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
_sandBag enableSimulationGlobal true;
_sandBag setPosASL _position;
_sandBag setDir _direction;
GVAR(placer) removeItem "ACE_Sandbag_empty";
GVAR(sandBag) = objNull;
GVAR(placer) = objNull;
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* call ace_sandbag_fnc_deployCancel;
* [] call ace_sandbag_fnc_deployCancel
*
* Public: No
*/
@ -34,14 +34,14 @@ GVAR(carrier) playActionNow "PutDown";
private ["_sandBag", "_position", "_direction"];
_position = getPosASL GVAR(sandBag);
_direction = getDir GVAR(sandBag);
deleteVehicle GVAR(sandBag);
_sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"];
_sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
_sandBag enableSimulationGlobal true;
_sandBag setPosASL _position;
_sandBag setDir _direction;
GVAR(sandBag) = objNull;
GVAR(carrier) = objNull;
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);

View File

@ -9,13 +9,13 @@
* handled <BOOL>
*
* Example:
* 1.2 call ace_sandbag_fnc_handleScrollWheel;
* [1.2] call ace_sandbag_fnc_handleScrollWheel
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_scroll);
params ["_scroll"];
if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(deployPFH) == -1) exitWith { false };

View File

@ -10,26 +10,26 @@
* None
*
* Example:
* [_sandbag, _unit] call ace_sandbag_fnc_pickup;
* [_sandbag, _unit] call ace_sandbag_fnc_pickup
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_sandbag,_unit);
params ["_sandbag", "_unit"];
_unit playActionNow "PutDown";
_unit setVariable [QGVAR(usingSandbag), true];
[{
PARAMS_2(_sandbag,_unit);
params ["_sandbag", "_unit"];
_unit setVariable [QGVAR(usingSandbag), false];
deletevehicle _sandbag;
// Force physx update
{
_x setPosASL (getPosASL _x);
} forEach (_unit nearObjects ["ACE_SandbagObject", 5]);
} count (_unit nearObjects ["ACE_SandbagObject", 5]);
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
}, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute);