fix in fcs vehicleInit

This commit is contained in:
commy2 2015-02-11 16:35:42 +01:00
parent 7360277d09
commit 3568d0d72e
2 changed files with 34 additions and 7 deletions

View File

@ -37,3 +37,31 @@ class Extended_Init_EventHandlers {
};
};
};
class Extended_FiredBIS_EventHandlers {
class Tank {
class ADDON {
clientInit = QUOTE(_this call FUNC(firedEH));
};
};
class Car {
class ADDON {
clientInit = QUOTE(_this call FUNC(firedEH));
};
};
class Helicopter {
class ADDON {
clientInit = QUOTE(_this call FUNC(firedEH));
};
};
class Plane {
class ADDON {
clientInit = QUOTE(_this call FUNC(firedEH));
};
};
class Ship_F {
class ADDON {
clientInit = QUOTE(_this call FUNC(firedEH));
};
};
};

View File

@ -17,9 +17,10 @@ private "_vehicle";
_vehicle = _this select 0;
{
if (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(Enabled)) == 1) then { // @todo for all turrets
_vehicle addEventHandler ["Fired", {_this call FUNC(firedEH)}];
private "_turretConfig";
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) then {
_vehicle setVariable [format ["%1_%2", QGVAR(Distance), _x], 0, true];
_vehicle setVariable [format ["%1_%2", QGVAR(Magazines), _x], [], true];
_vehicle setVariable [format ["%1_%2", QGVAR(Elevation), _x], [], true];
@ -27,12 +28,10 @@ _vehicle = _this select 0;
// calculate offset between gunner camera and muzzle position
if !(_vehicle isKindOf "Air") then {
private ["_turretConfig", "_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"];
private ["_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"];
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
_gunBeg = getText (_turretConfig >> "gunBeg"); // @todo player turret path
_gunnerView = getText (_turretConfig >> "memoryPointGunnerOptics"); // @todo player turret path
_gunBeg = getText (_turretConfig >> "gunBeg");
_gunnerView = getText (_turretConfig >> "memoryPointGunnerOptics");
_gunBegPos = (_vehicle selectionPosition _gunBeg) select 0;
_gunnerViewPos = (_vehicle selectionPosition _gunnerView) select 0;