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

Auto return leader role #298

Merged
merged 1 commit into from
Aug 30, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Info("initACEUnconsciousHandler started");
{
_unit setVariable ["incapacitated", true, true]; // for canFight tests

_groupLeader = leader (group _unit);

// Pass group lead if unit is the leader
if (_unit == leader (group _unit)) then
{
Expand All @@ -40,6 +42,10 @@ Info("initACEUnconsciousHandler started");
_unit setCaptive false; // match vanilla behaviour
};

if (_unit == _groupLeader) then {
group _unit selectLeader _unit;
};

if (isPlayer _unit) exitWith {}; // don't force surrender with players
if (_realSide != Occupants && _realSide != Invaders) exitWith {};
if (_unit getVariable ["surrendered", false]) exitWith {}; // don't surrender twice
Expand Down