Skip to content

Commit

Permalink
write to server RPT when workarounds are used
Browse files Browse the repository at this point in the history
might allow for more insight into the problems
  • Loading branch information
b-mayr-1984 committed Jul 21, 2024
1 parent f79df53 commit c01d11b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/diary/functions/fn_fixDroneAI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ if !(hasInterface) exitWith {};

private _drone = getConnectedUAV player;

// write to server RPT when this workaround is used
private _ServerLogEntry = format ["fn_fixDroneAI.sqf called by %1 while connected to '%2', which was local at the time? local=%3.", name player, _drone, local _drone];
[_ServerLogEntry] remoteExec ["diag_log", 2];

if (!isNull _drone) then {
// workaround for createVehicleCrew not being "global argument" and "global effect" for drones
// see https://discord.com/channels/105462288051380224/105465701543723008/1263215925042090004 for further details
Expand All @@ -27,7 +31,7 @@ if (!isNull _drone) then {

private _ret_setOwner = [ _drone, _clientID] remoteExec ["setOwner", 2];
private _ret_setGroupOwner = [group _drone, _clientID] remoteExec ["setGroupOwner", 2];
diag_log format ["fn_fixDroneAI.sqf: Change of drone ownership returned '%1' and '%2'."];
diag_log format ["fn_fixDroneAI.sqf: Change of drone ownership returned '%1' and '%2'.", _ret_setOwner, _ret_setGroupOwner];
};

[_drone] spawn { // need to change to scheduled environment in order to use waitUntil
Expand Down
6 changes: 5 additions & 1 deletion scripts/diary/functions/fn_placeMortarOnTerrain.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ See https://github.com/acemod/ACE3/issues/10010 for more information.

private _mortar = localNamespace getVariable "shootnscoot_lastUnloadedMortar";

// write to server RPT when this workaround is used
private _ServerLogEntry = format ["fn_placeMortarOnTerrain.sqf called by %1 while 'shootnscoot_lastUnloadedMortar=%2' and 'getPosATL=%3'.", name player, _mortar, getPosATL _mortar];
[_ServerLogEntry] remoteExec ["diag_log", 2];

if (!isNil "_mortar") then {
private _pos = getPosATL _mortar;
diag_log format ["fn_placeMortarOnTerrain.sqf: getPosATL=%1", _pos]; // logging output might help to narrow down the problem
_mortar setPosATL [_pos#0, _pos#1, 0]; // place at same x and y coordinate, but with z coordinate on the surface
hint parseText "<t color='#00ffff'>Should be fixed.</t><br/>Check your surroundings for the mortar!";
} else {
hint parseText "This restore function works on the last mortar that you've unloaded.<br/><t color='#ff0000'>You haven't unloaded a mortar yet.</t>";
};

0 comments on commit c01d11b

Please sign in to comment.