Skip to content

Commit

Permalink
params clean up & new EH
Browse files Browse the repository at this point in the history
  • Loading branch information
tuntematonjr committed Oct 2, 2021
1 parent a399ac3 commit 81d5a70
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions addons/Respawn/functions/fnc_moveRespawns.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Move respawns and give gear
*
* Arguments:
* 0: ("west","east","resistance","civilian") <STRING>
* 0: Side <SIDE>
*
* Return Value:
* The return value <BOOL>
Expand All @@ -20,23 +20,23 @@ if (!isServer) exitWith { };

private _players_in_respawn = [];

switch toLower(_side) do {
case "west": {
switch (_side) do {
case west: {
_respawn_position = getMarkerPos (GVAR(respawnpos_west) select 0);
_respawn_waitingarea = getpos (GVAR(waitingarea_west) select 1);
};

case "east": {
case east: {
_respawn_position = getMarkerPos (GVAR(respawnpos_east) select 0);
_respawn_waitingarea = getpos (GVAR(waitingarea_east) select 1);
};

case "guer": {
case resistance: {
_respawn_position = getMarkerPos (GVAR(respawnpos_guer) select 0);
_respawn_waitingarea = getpos (GVAR(waitingarea_guer) select 1);
};

case "civ": {
case civilian: {
_respawn_position = getMarkerPos (GVAR(respawnpos_civ) select 0);
_respawn_waitingarea = getpos (GVAR(waitingarea_civ) select 1);
};
Expand Down Expand Up @@ -72,6 +72,7 @@ private _fnc_timeisUp = {
private _text = "STR_Tun_Respawn_FNC_moveRespawns" call BIS_fnc_localize;
[_player, _respawn_position, _text, 20] call FUNC(teleport);
remoteExecCall [QFUNC(addGear), _player];
[QGVAR(EH_unitRespawned), [_player], _player] call CBA_fnc_localEvent;
};

{
Expand All @@ -81,4 +82,6 @@ private _fnc_timeisUp = {
[_fnc_timeisUp, [_player, _respawn_waitingarea, _respawn_position, _side], _execWaitTime] call CBA_fnc_waitAndExecute;
} forEach _players_in_respawn;

INFO(format ["Side %1 all respawn units moved", _side]);
INFO(format ["Side %1 all respawn units moved", _side]);

[QGVAR(EH_moveRespawns), [_side, _players_in_respawn]] call CBA_fnc_serverEvent;

0 comments on commit 81d5a70

Please sign in to comment.