Skip to content

Commit

Permalink
Moved over to a config implementation for vehicle radios instead of a…
Browse files Browse the repository at this point in the history
…n array.

Also added support for a variable tf_hasRadio to be set on the vehicle to signify support of radios.
  • Loading branch information
CorruptedHeart committed Feb 3, 2014
1 parent 9928b89 commit 5348b65
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,5 @@
* @param vehicle
* @return True|False
*/
private ["_presence", "_classes_with_radios"];
// presence of radio station
_presence = false;

_classes_with_radios = [
"Tank", "Air", "Wheeled_APC", // Common classes
"MRAP_01_base_F", //Hunter
"MRAP_02_base_F", //Ifrit
"O_MRAP_02_F", //Ifrit
"MRAP_03_base_F", //Strider
"I_MRAP_03_F", //Strider
"Offroad_01_armed_base_F", //Armed jeep
"Truck_01_base_F", // Blufor HEMTT
"Truck_02_base_F", //Opfor Zamak
"Wheeled_APC_F", // APC
"Boat_Armed_01_base_F", // Armed Speedboat
"C_Boat_Civil_01_police_F", //Motorboat (Police)
"C_Boat_Civil_01_rescue_F", //Motorboat (Rescue)
"SDV_01_base_F" //SDV
];

{ if ( _this isKindOf _x ) exitWith { _presence = true; }; } foreach _classes_with_radios;

_presence
if (_this getVariable ["tf_hasRadio", false]) exitWith {true};
(getNumber(configFile >> "CfgVehicles" >> (typeof _this) >> "tf_hasLRradio") == 1)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class CfgPatches
};

class CfgVehicles {
class Bag_Base;
class Bag_Base
{
tf_hasLRradio = 0;
};
class B_Kitbag_mcamo;
class B_Kitbag_cbr;
class B_Kitbag_sgg;
Expand All @@ -27,6 +30,7 @@ class CfgVehicles {
scope = 2;
maximumLoad = 60;
mass = 15;
tf_hasLRradio = 1;
};
class tf_anprc155: B_Kitbag_sgg
{
Expand All @@ -36,6 +40,7 @@ class CfgVehicles {
scope = 2;
maximumLoad = 60;
mass = 15;
tf_hasLRradio = 1;
};
class tf_mr3000: B_Kitbag_cbr
{
Expand All @@ -45,7 +50,9 @@ class CfgVehicles {
scope = 2;
maximumLoad = 60;
mass = 15;
tf_hasLRradio = 1;
};
#include "vehicles.hpp"
};

#define ANPRC_152(X,Y) class tf_anprc152_##X : ItemRadio \
Expand Down
69 changes: 69 additions & 0 deletions arma3/@task_force_radio/addons/task_force_radio_items/vehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
class All;
class AllVehicles:All
{
tf_hasLRradio = 0;
};
class LandVehicle;
class Tank:LandVehicle
{
tf_hasLRradio = 1;
};
class Air:AllVehicles
{
tf_hasLRradio = 1;
};
class Helicopter;
class ParachuteBase:Helicopter
{
tf_hasLRradio = 0;
};
class Car;
class Wheeled_Apc:Car
{
tf_hasLRradio = 1;
};
class Car_F;
class MRAP_01_base_F: Car_F
{
tf_hasLRradio = 1;
};
class MRAP_02_base_F: Car_F
{
tf_hasLRradio = 1;
};
class MRAP_03_base_F: Car_F
{
tf_hasLRradio = 1;
};
class Truck_F;
class Truck_01_base_F:Truck_F
{
tf_hasLRradio = 1;
};
class Truck_02_base_F:Truck_F
{
tf_hasLRradio = 1;
};
class Offroad_01_base_f;
class Offroad_01_armed_base_F:Offroad_01_base_f
{
tf_hasLRradio = 1;
};
class Boat_F;
class SDV_01_base_F: Boat_F
{
tf_hasLRradio = 1;
};
class Boat_Armed_01_base_F:Boat_F
{
tf_hasLRradio = 1;
};
class Boat_Civil_01_base_F;
class C_Boat_Civil_01_police_F:Boat_Civil_01_base_F
{
tf_hasLRradio = 1;
};
class C_Boat_Civil_01_rescue_F:Boat_Civil_01_base_F
{
tf_hasLRradio = 1;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,5 @@
* @param vehicle
* @return True|False
*/
private ["_presence", "_classes_with_radios"];
// presence of radio station
_presence = false;

_classes_with_radios = [
"Tank", "Air", "Wheeled_APC", // Common classes
"MRAP_01_base_F", //Hunter
"MRAP_02_base_F", //Ifrit
"O_MRAP_02_F", //Ifrit
"MRAP_03_base_F", //Strider
"I_MRAP_03_F", //Strider
"Offroad_01_armed_base_F", //Armed jeep
"Truck_01_base_F", // Blufor HEMTT
"Truck_02_base_F", //Opfor Zamak
"Wheeled_APC_F", // APC
"Boat_Armed_01_base_F", // Armed Speedboat
"C_Boat_Civil_01_police_F", //Motorboat (Police)
"C_Boat_Civil_01_rescue_F", //Motorboat (Rescue)
"SDV_01_base_F" //SDV
];

{ if ( _this isKindOf _x ) exitWith { _presence = true; }; } foreach _classes_with_radios;

_presence
if (_this getVariable ["tf_hasRadio", false]) exitWith {true};
(getNumber(configFile >> "CfgVehicles" >> (typeof _this) >> "tf_hasLRradio") == 1)

0 comments on commit 5348b65

Please sign in to comment.