Commit 6e67e4e7 authored by Razer's avatar Razer
Browse files

Merge branch 'feature/spawn-fixes' into 'staging'

Spawn System fixes

See merge request !46
parents b3c8d7cd d047f4b9
......@@ -14,7 +14,7 @@ class Plugins
name = "ApmsDB";
desc = "APMS's custom Database connection plugin";
tag = "DB";
version = 1.1;
version = 1.11;
requiredPlugins[] = {"PluginManager"};
};
};
......
......@@ -18,7 +18,7 @@
#ifndef SOURCE_CONSTANTS_HPP_
#define SOURCE_CONSTANTS_HPP_
#define DLLVERSIONSTRING "[1,0,5,1]"
#define DLLVERSIONSTRING "[1,0,5,2]"
#define CONFIG_FILE_NAME "libredex.cfg"
#define DB_DEBUG true
......
......@@ -20,7 +20,7 @@ DB_var_restoreObjectInProgress = true;
DB_var_savingObjects = true;
DB_var_runObjectMon = true;
_requiredVersion = [1,0,5,1];
_requiredVersion = [1,0,5,2];
_request = [PROTOCOL_LIBARY_FUNCTION_CHECK_VERSION,[]];
_version = [_request] call DB_fnc_sendRequest;
if !(_version select 2 > _requiredVersion select 2 || _version select 2 == _requiredVersion select 2 && _version select 3 >= _requiredVersion select 3) exitWith {
......
......@@ -8,9 +8,14 @@
* https://www.bistudio.com/community/licenses/arma-public-license-share-alike/
* https://www.bistudio.com/monetization/
*/
params[
["_marker","",[""]],
["_spawnType",-1,[-1]]
];
params["_marker","_spawnType"];
if (_marker isEqualTo "") exitWith {
[nil, ["water"]] call BIS_fnc_randomPos;
};
if(_spawnType == -1) then {diag_log "<Desolation>: ERROR: Spawn mode not set. Default will be used";_spawnType = 0};
......
......@@ -11,6 +11,8 @@
diag_log "<Desolation>: INFO: Finish spawn #1";
[player] remoteExec ["DB_fnc_registerCharacter",2];
waitUntil {!(isNull (findDisplay 46)) && isGameFocused};
// -_- Otherwise the code might not work as it should...
......
......@@ -22,13 +22,17 @@ _enable = (call compile (["EnableSpawnAreaSelection","DS"] call BASE_fnc_getCfgV
if!(_enable) exitWith {
_spawnRegions = [];
for "_i" from 0 to 20 do {
_region = (["Zone" + str(_i) + "Marker","DS"] call BASE_fnc_getCfgValue);
if !(isNil "_region") then {
_region = (["Zone" + str(_i) + "Marker","DS",""] call BASE_fnc_getCfgValue);
if !(_region isEqualTo "") then {
_spawnRegions pushback _region;
};
};
_spawnRegion = selectRandom _spawnRegions;
_spawnRegion = "";
if(count _spawnRegions > 0) then {
_spawnRegion = selectRandom _spawnRegions;
};
_spawnPos = [_spawnRegion,1] call DS_fnc_findSpawnPosition;
player setDir (random 360);
player setPosATL _spawnPos;
......
......@@ -14,26 +14,25 @@ params["_regionNum"];
diag_log "<Desolation>: INFO: On region select #1";
[player] remoteExec ["DB_fnc_registerCharacter",2];
// [[_marker,_text,_icon,_mode]];
private _settings = ((DS_var_SpawnSettings) select _regionNum);
private _marker = "";
private _mode = 1;
if !(isNil "DS_var_SpawnSettings") then {
private _settings = ((DS_var_SpawnSettings) select _regionNum);
private _marker = ((_settings) select 0);
private _mode = ((_settings) select 3);
if(_mode isEqualType []) then {
_mode = selectRandom _mode;
_marker = ((_settings) select 0);
_mode = ((_settings) select 3);
if(_mode isEqualType []) then {
_mode = selectRandom _mode;
};
};
// Spawn player at position
private _spawnPos = [_marker,_mode] call DS_fnc_findSpawnPosition;
player setDir (random 360);
player setpos _spawnPos;
waitUntil {player distance2D _spawnPos < 100}; //HALO jump support
diag_log "<Desolation>: INFO: On region select #2";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment