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

Debug Console - Include vehicles in editable objects and Fix respawn curator assignment #700

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handle broken assignment on respawn
  • Loading branch information
Mike-MF committed Jun 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c6b41d683884c8a4c5f2113c5611b0350cc4e473
1 change: 1 addition & 0 deletions addons/debug_console/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PREP(addButton);
PREP(addCurator);
PREP(handleDisconnect);
PREP(handleRespawn);
PREP(initDebugConsole);
1 change: 1 addition & 0 deletions addons/debug_console/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

if (isServer) then {
addMissionEventHandler ["HandleDisconnect", FUNC(handleDisconnect)];
addMissionEventHandler ["EntityRespawned", FUNC(handleRespawn)];
[QGVAR(createCurator), FUNC(addCurator)] call CBA_fnc_addEventHandler;
[QGVAR(stopRain), {
params ["_caller"];
30 changes: 30 additions & 0 deletions addons/debug_console/functions/fnc_handleRespawn.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: Mike
* Handles respawn of players.
*
* Arguments:
* 0: New Unit <OBJECT>
* 1: Old Unit <OBJECT> (Unused)
*
* Return Value:
* None
*
* Public: No
*/

params ["_newUnit", "_oldUnit"];

if (GVAR(playerCurators) isEqualTo []) exitWith {};

private _playerUID = getPlayerUID _newUnit;
private _moduleData = GVAR(playerCurators) select {_playerUID in _x};

if (_moduleData isEqualTo []) exitWith {};

// Break old curator assignment
private _module = (_moduleData select 0) select 0;
unassignCurator _module;

// Reassign curator back to original player
_module assignCurator _newUnit;