More code optimization from HeMan

This commit is contained in:
Chris Cardozo 2018-11-18 16:08:53 -05:00
parent a5b40c08c3
commit 782bba997e
5 changed files with 38 additions and 41 deletions

View File

@ -30,34 +30,36 @@ blck_fnc_sm_AddVehicle = compileFinal preprocessFileLineNumbers "\q\addons\cust
blck_fnc_sm_AddAircraft = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddAircraft.sqf";
blck_fnc_sm_AddEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddEmplaced.sqf";
*/
blck_fnc_sm_monitorStaticUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf";
blck_fnc_sm_monitorInfantry = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorInfantry.sqf";
blck_fnc_sm_monitorScuba = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorScuba.sqf";
blck_fnc_sm_monitorVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorVehicles.sqf";
blck_fnc_sm_monitorAircraft = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorAircraft.sqf";
blck_fnc_sm_monitorShips = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorShips.sqf";
blck_fnc_sm_monitorSubs = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorSubs.sqf";
blck_fnc_sm_monitorEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorEmplaced.sqf";
blck_fnc_sm_monitorGarrisonsASL = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisonsASL.sqf";
blck_fnc_sm_monitorGarrisons_relPos = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisons_relPos.sqf";
blck_fnc_sm_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrol.sqf";
blck_fnc_sm_spawnAirPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrol.sqf";
blck_fnc_sm_spawnEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf";
//blck_fnc_sm_spawnInfantryPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf";
blck_fnc_sm_missionPatrolMonitor = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf";
//blck_fnc_sm_checkForPlayerNearMission = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_checkForPlayerNearMission.sqf";
blck_fnc_sm_spawnAirPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrols.sqf";
blck_fnc_sm_spawnEmplaceds = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf";
blck_fnc_sm_spawnInfantryPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnInfantryPatrols.sqf";
blck_fnc_sm_spawnLootContainers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnLootContainers.sqf";
blck_fnc_sm_spawnObjects = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjects.sqf";
blck_fnc_sm_spawnVehiclePatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrols.sqf";
blck_fnc_sm_spawnBuildingGarrison_ASL = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrisonASL.sqf";
blck_fnc_sm_spawnBuildingGarrison_relPos = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf";
blck_fnc_sm_spawnObjectASLVectorDirUp = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf";
private _functions = [
["blck_fnc_sm_monitorStaticUnits","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf"],
["blck_fnc_sm_monitorInfantry","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorInfantry.sqf"],
["blck_fnc_sm_monitorScuba","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorScuba.sqf"],
["blck_fnc_sm_monitorVehicles","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorVehicles.sqf"],
["blck_fnc_sm_monitorAircraft","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorAircraft.sqf"],
["blck_fnc_sm_monitorShips","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorShips.sqf"],
["blck_fnc_sm_monitorSubs","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorSubs.sqf"],
["blck_fnc_sm_monitorEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorEmplaced.sqf"],
["blck_fnc_sm_monitorGarrisonsASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisonsASL.sqf"],
["blck_fnc_sm_monitorGarrisons_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisons_relPos.sqf"],
["blck_fnc_sm_spawnVehiclePatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrol.sqf"],
["blck_fnc_sm_spawnAirPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrol.sqf"],
["blck_fnc_sm_spawnEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"],
// ["blck_fnc_sm_spawnInfantryPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf"],
["blck_fnc_sm_missionPatrolMonitor","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf"],
// ["blck_fnc_sm_checkForPlayerNearMission","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_checkForPlayerNearMission.sqf"],
["blck_fnc_sm_spawnAirPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrols.sqf"],
["blck_fnc_sm_spawnEmplaceds","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"],
["blck_fnc_sm_spawnInfantryPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnInfantryPatrols.sqf"],
["blck_fnc_sm_spawnLootContainers","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnLootContainers.sqf"],
["blck_fnc_sm_spawnObjects","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjects.sqf"],
["blck_fnc_sm_spawnVehiclePatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrols.sqf"],
["blck_fnc_sm_spawnBuildingGarrison_ASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrisonASL.sqf"],
["blck_fnc_sm_spawnBuildingGarrison_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf"],
["blck_fnc_sm_spawnObjectASLVectorDirUp","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf"]
];
{
_x params ["_name","_path"];
missionnamespace setvariable [_name,compileFinal preprocessFileLineNumbers _path];
} foreach _functions;
diag_log "[blckeagls] GMS_sm_init_functions.sqf <Variables Defined and Functions Loaded>";
blck_sm_functionsLoaded = true;

View File

@ -16,10 +16,10 @@ private ["_staticMissions"];
_staticMissions = [
// [mod (Epoch, Exile), map (Altis, Tanoa etc), mission center, eg [10445,2014,0], filename.sqf (name of static mission template for that mission)];
//["Epoch","Altis","template.sqf"],
//["Epoch","Altis","staticMissionExample2_Epoch.sqf"],
["Epoch","Altis","staticMissionExample2_Epoch.sqf"],
//["Epoch","Altis","destroyer.sqf"],
//["Exile","Altis","template.sqf"],
//["Exile","Altis","staticMissionExample2_Exile.sqf"]
["Exile","Altis","staticMissionExample2_Exile.sqf"]
];
diag_log "[blckeagls] GMS_StaticMissions_Lists.sqf <Loaded>";

View File

@ -17,14 +17,11 @@
#include "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_init_functions.sqf";
#include "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_Lists.sqf";
private["_mod","_map","_missionMod","_missionMap","_missionLocation","_missionDataFile"];
blck_sm_monitoring = 0;
blck_sm_groupDespawnTime = 30;
blck_sm_patrolRespawnInterval = 30;
uiSleep 10;
_map = toLower worldName;
{
if ((_map) isEqualTo toLower(_x select 1)) then
if ((toLower worldName) isEqualTo toLower(_x select 1)) then
{
if ((blck_ModType isEqualTo "Epoch") && (toLower(_x select 0) isEqualTo "epoch")) then
{
@ -36,7 +33,6 @@ _map = toLower worldName;
call compilefinal preprocessFileLineNumbers format["\q\addons\custom_server\Missions\Static\missions\%1",(_x select 2)];
};
};
uiSleep 1;
}forEach _staticMissions;
diag_log "[blckeagls] GMS_StaticMissions Initialized.sqf <Loaded>";

View File

@ -16,7 +16,7 @@ private ["_staticMissions"];
_staticMissions = [
// [mod (Epoch, Exile), map (Altis, Tanoa etc), mission center, eg [10445,2014,0], filename.sqf (name of static mission template for that mission)];
//["Epoch","Altis","staticMissionExample2_Epoch.sqf"],
//["Exile","Altis","staticMissionExample2_Exile.sqf"]
["Epoch","Altis","staticMissionExample2_Epoch.sqf"],
["Exile","Altis","staticMissionExample2_Exile.sqf"]
];

View File

@ -9,7 +9,6 @@
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private _modType = call blck_fnc_getModType;
blck_UMS_uniforms =
[
"U_I_Wetsuit",
@ -37,7 +36,7 @@ blck_UMS_weapons =
"arifle_SDAR_F"
];
if (_modType isEqualTo "Exile") then
if ((tolower blck_modType) isEqualTo "exile") then
{
blck_UMS_submarines =
[
@ -52,7 +51,7 @@ if (_modType isEqualTo "Exile") then
"Exile_Container_SupplyBox"
];
};
if (_modType isEqualTo "Epoch") then
if ((tolower blck_modType) isEqualTo "epoch") then
{
blck_UMS_submarines =
[