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

Script Error in VCM_fnc_ClstEmy #136

Open
Chronophylos opened this issue Jul 10, 2019 · 3 comments
Open

Script Error in VCM_fnc_ClstEmy #136

Chronophylos opened this issue Jul 10, 2019 · 3 comments
Assignees
Labels
bug Something isn't working Needs Further Testing After no more bug reports of these kinds, for roughly one month, bug will be closed.

Comments

@Chronophylos
Copy link

Describe the bug
I see this in the server log a lot.

To Reproduce
can't

Expected behavior
No errors in the log

VCOM Version: 3.3.2

Additional mods used:

  • CBA_A3 (v3.11.2)

Additional context
The log message:

private _a1 = [];
{
private>
19:04:18   Error position: <side _this);
private _a1 = [];
{
private>
19:04:18   Error side: Type Array, expected Object,Group,Location
19:04:18 File \vcomai\Vcom\Functions\VCM_Functions\fn_ClstEmy.sqf [VCM_fnc_ClstEmy], line 16
19:04:23 Error in expression <]"
@Chronophylos Chronophylos added the bug Something isn't working label Jul 10, 2019
@genesis92x genesis92x self-assigned this Jul 15, 2019
@genesis92x
Copy link
Owner

Hopefully fixed with the highlighted change below.

`
if (_this isEqualType []) exitWith {_rtrn = [0,0,0];_rtrn};

private _unitSide = (side _this);
private _a1 = [];
{
private _targetSide = side _x;
if ([_unitSide, _targetSide] call BIS_fnc_sideIsEnemy && {!(vehicle _X isKindOf "Air")}) then {_a1 pushback _x;};
} forEach allUnits;

private _rtrn = [_a1,_this,true,"1"] call VCM_fnc_ClstObj;
if (isNil "_rtrn") then {_rtrn = [0,0,0]};

_rtrn`

@genesis92x genesis92x added the Needs Further Testing After no more bug reports of these kinds, for roughly one month, bug will be closed. label Jul 15, 2019
@KnatteAnka
Copy link

I do have the same error using enigma trafic script that spawns civilian traffic

with the fix i do only get a new error:

9:06:58 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:06:58 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:06:58 Error vehicle: Type Array, expected Object
9:06:59 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:06:59 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:06:59 Error vehicle: Type Array, expected Object
9:06:59 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:06:59 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:06:59 Error vehicle: Type Array, expected Object
9:07:03 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:03 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:03 Error vehicle: Type Array, expected Object
9:07:04 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:04 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:04 Error vehicle: Type Array, expected Object
9:07:04 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:04 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:04 Error vehicle: Type Array, expected Object
9:07:08 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:08 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:08 Error vehicle: Type Array, expected Object
9:07:09 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:09 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:09 Error vehicle: Type Array, expected Object
9:07:09 Error in expression <_NearestFriendly2Enemy targetKnowledge (vehicle _NearestEnemy)) select 6;
privat>
9:07:09 Error position: <vehicle _NearestEnemy)) select 6;
privat>
9:07:09 Error vehicle: Type Array, expected Object

@KnatteAnka
Copy link

After allot of debuging i found the correct fix for this bug :D :D
First declare of _rtrn may not be needed but i do like to declare before and objNull is when red possition as [0,0,0]

private _unitSide = (side _this);
private _rtrn = objNull;

if (typeName _this != typeName []) then {
	private _a1 = [];
	{
		private _targetSide = side _x;
		if ([_unitSide, _targetSide] call BIS_fnc_sideIsEnemy && {!(vehicle _X isKindOf "Air")}) then {_a1 pushback _x;};
	} forEach allUnits;
	
	private _rtrn = [_a1,_this,true,"1"] call VCM_fnc_ClstObj;
	
//}
//else{
	//diag_log	format ["VCOM_PROBLEM Else CLSTEmy.SQF:%1",_this];
	//private _rtrn = objNull;
};

if (isNil "_rtrn") then {	_rtrn = objNull;	};
//diag_log	format ["VCOM_PROBLEM CLSTEmy.SQF|%1|%2",_rtrn,_this];
_rtrn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs Further Testing After no more bug reports of these kinds, for roughly one month, bug will be closed.
Projects
None yet
Development

No branches or pull requests

3 participants