Commit 3140d2ec authored by vabene1111's avatar vabene1111
Browse files

moved registerPlayer to finishSpawn

to prevent forgetting this in any script execution branch when refactoring any spawn code
parent fb20e49f
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
diag_log "<Desolation>: INFO: Finish spawn #1"; diag_log "<Desolation>: INFO: Finish spawn #1";
[player] remoteExec ["DB_fnc_registerCharacter",2];
waitUntil {!(isNull (findDisplay 46)) && isGameFocused}; waitUntil {!(isNull (findDisplay 46)) && isGameFocused};
// -_- Otherwise the code might not work as it should... // -_- Otherwise the code might not work as it should...
......
...@@ -32,7 +32,7 @@ if!(_enable) exitWith { ...@@ -32,7 +32,7 @@ if!(_enable) exitWith {
if(count _spawnRegions > 0) then { if(count _spawnRegions > 0) then {
_spawnRegion = selectRandom _spawnRegions; _spawnRegion = selectRandom _spawnRegions;
}; };
_spawnPos = [_spawnRegion,1] call DS_fnc_findSpawnPosition; _spawnPos = [_spawnRegion,1] call DS_fnc_findSpawnPosition;
player setDir (random 360); player setDir (random 360);
player setPosATL _spawnPos; player setPosATL _spawnPos;
......
...@@ -14,26 +14,20 @@ params["_regionNum"]; ...@@ -14,26 +14,20 @@ params["_regionNum"];
diag_log "<Desolation>: INFO: On region select #1"; diag_log "<Desolation>: INFO: On region select #1";
[player] remoteExec ["DB_fnc_registerCharacter",2];
// [[_marker,_text,_icon,_mode]]; // [[_marker,_text,_icon,_mode]];
private _settings = ((DS_var_SpawnSettings) select _regionNum); private _settings = ((DS_var_SpawnSettings) select _regionNum);
private _marker = ((_settings) select 0); private _marker = ((_settings) select 0);
private _mode = ((_settings) select 3); private _mode = ((_settings) select 3);
if(_mode isEqualType []) then { if(_mode isEqualType []) then {
_mode = selectRandom _mode; _mode = selectRandom _mode;
}; };
// Spawn player at position // Spawn player at position
private _spawnPos = [_marker,_mode] call DS_fnc_findSpawnPosition; private _spawnPos = [_marker,_mode] call DS_fnc_findSpawnPosition;
player setDir (random 360); player setDir (random 360);
player setpos _spawnPos; player setpos _spawnPos;
waitUntil {player distance2D _spawnPos < 100}; //HALO jump support waitUntil {player distance2D _spawnPos < 100}; //HALO jump support
diag_log "<Desolation>: INFO: On region select #2"; 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