mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix init issue
This commit is contained in:
parent
a37d97103f
commit
85270e4521
@ -16,7 +16,6 @@ class CfgWeapons {
|
|||||||
class CannonCore;
|
class CannonCore;
|
||||||
class mortar_82mm: CannonCore {
|
class mortar_82mm: CannonCore {
|
||||||
class Single1;
|
class Single1;
|
||||||
GVAR(replaceWith) = "ACE_mortar_82mm";
|
|
||||||
};
|
};
|
||||||
class ACE_mortar_82mm: mortar_82mm {
|
class ACE_mortar_82mm: mortar_82mm {
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_mortar"];
|
params ["_mortar"];
|
||||||
|
private ["_newWeapon","_currentWeapon"];
|
||||||
|
|
||||||
if (_mortar getVariable [QGVAR(initialized),false] || _mortar getVariable [QGVAR(exclude),false]) exitWith {};
|
if (_mortar getVariable [QGVAR(initialized),false] || _mortar getVariable [QGVAR(exclude),false]) exitWith {};
|
||||||
|
|
||||||
@ -25,8 +26,14 @@ if (count magazines _mortar > 0) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Replace current weapon with ammo handling weapon
|
// Replace current weapon with ammo handling weapon
|
||||||
private _currentWeapon = _mortar weaponsTurret [0] select 0;
|
_currentWeapon = _mortar weaponsTurret [0] select 0;
|
||||||
private _newWeapon = getText (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(replaceWith));
|
|
||||||
|
if (_currentWeapon == "mortar_82mm") then {
|
||||||
|
_newWeapon = "ace_mortar_82mm"
|
||||||
|
} else {
|
||||||
|
_newWeapon = getText (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(replaceWith));
|
||||||
|
};
|
||||||
|
|
||||||
if (_newWeapon != "") then {
|
if (_newWeapon != "") then {
|
||||||
_mortar removeWeaponGlobal _currentWeapon;
|
_mortar removeWeaponGlobal _currentWeapon;
|
||||||
_mortar addWeaponGlobal _newWeapon;
|
_mortar addWeaponGlobal _newWeapon;
|
||||||
|
Loading…
Reference in New Issue
Block a user