Page MenuHomeFeedback Tracker

Weird paramters passed to some event handlers
New, NormalPublic

Description

The first one weird behavior with the FiredMan EH on dedicated server - I got the following message during checking:

Unit of type SPE_GER_SquadLead fired with params: [B Bravo 3-4:1,B Bravo 3-4:1,0,"LIB_FLARE_PISTOL","LIB_FLARE_PISTOL","Single","LIB_40mm_Red",B Bravo 3-4:1]

while locally it works as intended:

Unit of type SPE_GER_SquadLead fired with params: [B Bravo 3-4:1,"LIB_FLARE_PISTOL","LIB_FLARE_PISTOL","Single","LIB_40mm_Red","LIB_1Rnd_flare_red",1832480: ugl_flare.p3d,<NULL-object>]

The second one with the EpeContactStart/End, when the first passed parameter was a string, and not an object.

Details

Severity
None
Resolution
Open
Reproducibility
Random
Operating System
Windows 7 x64
Category
General
Steps To Reproduce
addMissionEventHandler ["EntityCreated",OT_fnc_entityspawned];
OT_fnc_entityspawned = {
params ["_unit"];
if (_unit isKindOf "Man") then {
	_unit allowdamage false;
	_unit spawn {
		sleep 3;
		_this allowdamage true;
		if !(isPlayer leader _this) then {
			_this call OT_fnc_replace;
		};
	};
};
};

OT_fnc_replace = {
params ["_unit"];

_unit addEventHandler ["FiredMan", {
   params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
	diag_log format ["Unit of type %2 fired with params: %1",_this,typeof _unit];
    if !(_muzzle isEqualType "" && {_muzzle == "LIB_FLARE_PISTOL" && {alive _unit && {(server getvariable ["NATOmanpower",3000]) > 100}}}) exitWith {};
	[{
		params ["_unit","_projectile","_hndl"];
		diag_log "Doing something";
	}, [_unit,_projectile,_thisEventHandler], 4] call CBA_fnc_waitAndExecute;
}];
};

The result was stable on dedicated, until I added an additional condition check.

[_veh, ["EpeContactStart",{
	params ["_o1", "_o2", "", "", "_force"];
	if !(local _o1) exitWith {};
	_exp = _o1 getvariable ["exp",0];
	if (side _o1 in [west, civilian] && {side _o2 in [west, civilian]}) then {
	    diag_log "Doing something";
        };
}]] remoteexeccall ["addEventHandler",0];

Result:

Error position: <side _o2 in [west, civilian]}) then {
Error side: Type String, expected Object,Group,Location

Happens on the server only, and I encountered it when I added EH via remoteexec on all machines, but before it was only added on vehicles which were local to the server.

Event Timeline

MaxP created this task.Nov 10 2023, 1:28 AM
MaxP edited Steps To Reproduce. (Show Details)
MaxP edited Steps To Reproduce. (Show Details)Nov 10 2023, 1:49 AM
MaxP edited Steps To Reproduce. (Show Details)Nov 10 2023, 3:05 AM