2016-04-10 15:25:24 +00:00
|
|
|
/*
|
|
|
|
Author: IT07
|
|
|
|
|
|
|
|
Description: checks the side of given unit and returns it
|
|
|
|
|
|
|
|
Params:
|
|
|
|
_this: STRING - unit classname
|
|
|
|
|
|
|
|
Returns: SIDE - unit's side
|
|
|
|
*/
|
|
|
|
|
2016-04-13 20:28:31 +00:00
|
|
|
private ["_return"];
|
2016-04-10 15:25:24 +00:00
|
|
|
if (_this isEqualType "") then
|
|
|
|
{
|
2016-04-13 20:28:31 +00:00
|
|
|
private ["_cfg"];
|
2016-04-10 15:25:24 +00:00
|
|
|
_cfg = configFile >> "CfgVehicles" >> _this >> "faction";
|
|
|
|
if not isNull _cfg then
|
|
|
|
{
|
2016-04-13 20:28:31 +00:00
|
|
|
private ["_faction"];
|
2016-04-10 15:25:24 +00:00
|
|
|
_faction = getText _cfg;
|
|
|
|
switch _faction do
|
|
|
|
{
|
|
|
|
case "BLU_G_F":
|
|
|
|
{
|
|
|
|
_return = WEST;
|
|
|
|
};
|
|
|
|
case "CIV_F":
|
|
|
|
{
|
|
|
|
_return = civilian;
|
|
|
|
};
|
|
|
|
case "IND_F":
|
|
|
|
{
|
|
|
|
_return = independent;
|
|
|
|
};
|
|
|
|
case "IND_G_F":
|
|
|
|
{
|
|
|
|
_return = resistance;
|
|
|
|
};
|
|
|
|
case "OPF_F":
|
|
|
|
{
|
|
|
|
_return = EAST;
|
|
|
|
};
|
|
|
|
default
|
|
|
|
{
|
|
|
|
["fn_checkSide", 0, format["Fatal error; Unknown faction '%1'", _faction]] spawn VEMFr_fnc_log;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_return
|