Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove manual team synching #2803

Merged
merged 1 commit into from
Nov 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler);
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);

if (isServer) then {
Expand Down
8 changes: 0 additions & 8 deletions addons/interaction/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ GVAR(isOpeningDoor) = false;
["displayTextStructured", _message] call EFUNC(common,targetEvent);
}] call EFUNC(common,addEventHandler);

// restore global fire teams for JIP
private "_team";
{
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
false
} count allUnits;

// add keybinds
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
// Conditions: canInteract
Expand Down
6 changes: 1 addition & 5 deletions addons/interaction/functions/fnc_joinTeam.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@

params ["_unit", "_team"];

// make sure correct team is set on JIP
_unit setVariable [QGVAR(assignedFireTeam), _team, true];

// join fire team on every machine in that group
["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent);
["CBA_teamColorChanged", [_unit, _team]] call CBA_fnc_globalEvent;

// display message
if (_unit == ACE_player) then {
Expand Down
36 changes: 0 additions & 36 deletions addons/nametags/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,6 @@ GVAR(showNamesTime) = -10;
{false},
[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key

// Monitor the assigned teams, and propegate them appropriately for the player
// This allows for assigned team colors to match across the entire group
[{
private["_leader", "_playerIsLeader", "_unitTeam"];
if (!(isNull ACE_player) && { alive ACE_player } ) then {
_leader = leader (group ACE_player);
_playerIsLeader = false;

if(alive _leader) then {
if(_leader == ACE_player) then {
_playerIsLeader = true;
};
};

if (_playerIsLeader) then {
{
if(alive _x) then {
_unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"];
if (_unitTeam != assignedTeam _x) then {
_x setVariable [QGVAR(teamAssignment), assignedTeam _x,true];
};
};
} forEach units (group ACE_player);
} else {
{
if(alive _x) then {
_unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"];
if (_unitTeam != assignedTeam _x) then {
_x assignTeam _unitTeam;
};
};
} forEach units (group ACE_player);
};
};
}, 5, []] call CBA_fnc_addPerFrameHandler;

// Wait until the colors are defined before starting to draw the nametags
["SettingsInitialized", {
// Draw handle
Expand Down