Merge branch 'release'

This commit is contained in:
PabstMirror
2016-03-16 16:50:04 -05:00
9 changed files with 35 additions and 33 deletions

View File

@ -7,3 +7,8 @@
[QGVAR(startFastRope), { [QGVAR(startFastRope), {
[FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler; [FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
[QGVAR(ropeDetach), {
params ["_object", "_rope"];
_object ropeDetach _rope;
}] call EFUNC(common,addEventHandler);

View File

@ -32,10 +32,8 @@ _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
}; };
}; };
detach _dummy; [QGVAR(ropeDetach), [_hook, _ropeTop]] call EFUNC(common,serverEvent);
deleteVehicle _ropeTop; [{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy, _hook], 60] call EFUNC(common,waitAndExecute);
deleteVehicle _hook;
[{{deleteVehicle _x} count _this}, [_ropeBottom, _dummy], 60] call EFUNC(common,waitAndExecute);
} count _deployedRopes; } count _deployedRopes;
_vehicle setVariable [QGVAR(deployedRopes), [], true]; _vehicle setVariable [QGVAR(deployedRopes), [], true];

View File

@ -35,14 +35,13 @@ _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
_origin = getPosATL _hook; _origin = getPosATL _hook;
_dummy = createVehicle [QGVAR(helper), _origin, [], 0, "CAN_COLLIDE"]; _dummy = createVehicle [QGVAR(helper), _origin vectorAdd [0, 0, -1], [], 0, "CAN_COLLIDE"];
_dummy allowDamage false; _dummy allowDamage false;
_dummy disableCollisionWith _vehicle; _dummy disableCollisionWith _vehicle;
_dummy attachTo [_hook, [0, 0, 0]];
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5]; _ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1]; _ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1];
ropeUnwind [_ropeBottom, 30, 35, false]; ropeUnwind [_ropeBottom, 30, 34.5, false];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}]; _ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}]; _ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];

View File

@ -26,7 +26,6 @@ if (vehicle _unit != _unit) exitWith {};
//Start fast roping //Start fast roping
if (animationState _unit != "ACE_FastRoping") exitWith { if (animationState _unit != "ACE_FastRoping") exitWith {
detach _dummy;
_unit disableCollisionWith _dummy; _unit disableCollisionWith _dummy;
_unit attachTo [_dummy, [0, 0, -1.45]]; _unit attachTo [_dummy, [0, 0, -1.45]];
[_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation); [_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation);

View File

@ -54,14 +54,14 @@ if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorM
deleteVehicle _ropeBottom; deleteVehicle _ropeBottom;
_origin = getPosASL _hook; _origin = getPosASL _hook;
_dummy attachTo [_hook, [0, 0, 0]]; _dummy setPosASL (_origin vectorAdd [0, 0, -1]);
//Restore original mass and center of mass //Restore original mass and center of mass
_dummy setMass 40; _dummy setMass 40;
_dummy setCenterOfMass [0.000143227,0.00105986,-0.246147]; _dummy setCenterOfMass [0.000143227,0.00105986,-0.246147];
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5]; _ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 35]; _ropeBottom = ropeCreate [_dummy, [0, 0, 0], 34.5];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}]; _ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}]; _ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];

View File

@ -15,6 +15,8 @@
_static setMagazineTurretAmmo [_magazine, _ammoCount, [0]]; _static setMagazineTurretAmmo [_magazine, _ammoCount, [0]];
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
["initMortar", {_this call FUNC(mortarInit);}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler); ["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler);

View File

@ -16,31 +16,30 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_player,_newVehicle); params ["_player", "_newVehicle"];
private["_tubeWeaponName" ,"_fireModes", "_lastFireMode"];
if (isNull _newVehicle) exitWith {}; if (isNull _newVehicle) exitWith {};
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {}; if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
// Run magazine handling initialization if enabled // Run magazine handling initialization if enabled
if (!EGVAR(common,settingsInitFinished)) then { if (!(_newVehicle getVariable [QGVAR(initialized),false]) && !(_newVehicle getVariable [QGVAR(exclude),false])) then {
EGVAR(common,runAtSettingsInitialized) pushBack [{ // Make sure that mortar init is executed after settings init
if (GVAR(useAmmoHandling) && {!(_this getVariable [QGVAR(initialized),false]) && !(_this getVariable [QGVAR(exclude),false])}) then { [{
_this call FUNC(mortarInit); params ["_mortar"];
if (GVAR(useAmmoHandling) && {!(_mortar getVariable [QGVAR(initialized),false]) && !(_mortar getVariable [QGVAR(exclude),false])}) then {
//wait for proper turret locality change
[{
["initMortar", [_this], [_this]] call EFUNC(common,globalEvent);
}, _mortar, 0.05] call EFUNC(common,waitAndExecute);
}; };
}, _newVehicle]; }, _newVehicle] call EFUNC(common,runAfterSettingsInit);
} else {
if (GVAR(useAmmoHandling) && {!(_newVehicle getVariable [QGVAR(initialized),false]) && !(_newVehicle getVariable [QGVAR(exclude),false])}) then {
_newVehicle call FUNC(mortarInit);
};
}; };
_tubeWeaponName = (weapons _newVehicle) select 0; private _tubeWeaponName = (weapons _newVehicle) select 0;
_fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes"); private _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes");
//Restore last firemode: //Restore last firemode:
_lastFireMode = _newVehicle getVariable [QGVAR(lastFireMode), -1]; private _lastFireMode = _newVehicle getVariable [QGVAR(lastFireMode), -1];
if (_lastFireMode != -1) then { if (_lastFireMode != -1) then {
_player action ["SwitchWeapon", _newVehicle, _player, _lastFireMode]; _player action ["SwitchWeapon", _newVehicle, _player, _lastFireMode];
}; };

View File

@ -18,27 +18,28 @@
params ["_mortar"]; params ["_mortar"];
if (_mortar getVariable [QGVAR(initialized),false] || _mortar getVariable [QGVAR(exclude),false]) exitWith {TRACE_1("Exit",_mortar)}; if (_mortar getVariable [QGVAR(initialized),false] || _mortar getVariable [QGVAR(exclude),false]) exitWith {TRACE_1("Exit",_mortar)};
if (!(_mortar turretLocal [0])) exitWith {TRACE_1("Exit - turret not local",_mortar)};
// Remove all magazines // Remove all magazines from turret
if (count magazines _mortar > 0) then { if (count magazines _mortar > 0) then {
{ {
[QGVAR(removeMagazine), [_mortar, _x]] call EFUNC(common,globalEvent); _mortar removeMagazineTurret [_x,[0]];
} forEach magazines _mortar; } forEach magazines _mortar;
}; };
// Replace current weapon with ammo handling weapon // Replace current turret weapon with ammo handling weapon
private _currentWeapon = _mortar weaponsTurret [0] select 0; private _currentWeapon = _mortar weaponsTurret [0] select 0;
private _newWeapon = ""; private _newWeapon = "";
if (_currentWeapon == "mortar_82mm") then { if (tolower _currentWeapon == "mortar_82mm") then {
_newWeapon = "ace_mortar_82mm"; _newWeapon = "ace_mortar_82mm";
} else { } else {
_newWeapon = getText (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(replaceWith)); _newWeapon = getText (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(replaceWith));
}; };
if (_newWeapon != "") then { if (_newWeapon != "") then {
_mortar removeWeaponGlobal _currentWeapon; _mortar removeWeaponTurret [_currentWeapon,[0]];
_mortar addWeaponGlobal _newWeapon; _mortar addWeaponTurret [_newWeapon,[0]];
}; };
_mortar setVariable [QGVAR(initialized),true,true]; _mortar setVariable [QGVAR(initialized),true,true];

View File

@ -16,7 +16,7 @@
#include "script_component.hpp" #include "script_component.hpp"
_fnc_isLeaning = { GVAR(tagsToTest) = GVAR(tagsToTest) select {
params ["_tag", "_tagPosASL", "_vectorDirAndUp"]; params ["_tag", "_tagPosASL", "_vectorDirAndUp"];
_vectorDirAndUp params ["_v1", "_v2"]; _vectorDirAndUp params ["_v1", "_v2"];
@ -34,7 +34,6 @@ _fnc_isLeaning = {
}; };
true true
}; };
GVAR(tagsToTest) = [GVAR(tagsToTest), _fnc_isLeaning] call EFUNC(common,filter);
// If there's no more tag // If there's no more tag
if (GVAR(tagsToTest) isEqualTo []) exitWith { if (GVAR(tagsToTest) isEqualTo []) exitWith {