From beed7ee8e55bf18f176592c95889d54e0e63522e Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Fri, 25 Aug 2023 16:06:17 +0200 Subject: [PATCH] Added test macro for respanw and spawn weapon --- addons/infantry/CfgVehicles.hpp | 3 +-- addons/main/script_macros.hpp | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/infantry/CfgVehicles.hpp b/addons/infantry/CfgVehicles.hpp index 7d674185..c370c40e 100644 --- a/addons/infantry/CfgVehicles.hpp +++ b/addons/infantry/CfgVehicles.hpp @@ -34,8 +34,7 @@ class CfgVehicles { uniformClass = "rhs_uniform_cu_ocp_1stcav"; - weapons[] = {"rhs_weap_m4a1_carryhandle","Throw","Put"}; - respawnWeapons[] = {"rhs_weap_m4a1_carryhandle","Throw","Put"}; + MACRO_SPAWN_WEAPON(rhs_weap_m4a1_carryhandle); magazines[] = { MULT_OBJ_12(rhs_mag_30Rnd_556x45_M855A1_Stanag) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index d7804550..4d46e6fa 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -81,6 +81,11 @@ item = ##BARREL; \ } +#define MACRO_SPAWN_WEAPON(WEAPON) \ + weapons[] = { QUOTE(WEAPON), QUOTE(Throw), QUOTE(Put) }; \ + respawnWeapons[] = { QUOTE(WEAPON), QUOTE(Throw), QUOTE(Put) } + + #define MULT_OBJ_0(a) #define MULT_OBJ_1(a) QUOTE(a) #define MULT_OBJ_2(a) MULT_OBJ_1(a), QUOTE(a)