auQuiksilver / Apex-Framework

Apex Framework
MIT License
85 stars 48 forks source link

AI occasionally stops spawning in main AO #26

Closed thegamecracks closed 2 years ago

thegamecracks commented 2 years ago

Mission version

1.3.0 (modified)

Observed Behaviour

After a while with several main AOs having been completed, the AI stop spawning in the next AO and eventually players see no enemies remaining in the AO. When observing the server log, this error message appears once, indicating that the fn_AI.sqf script crashed:

18:04:03 Error in expression <issions') select {(_QS_serverTime < (_x # 2))}),QS_system_AI_owners];
};
_QS_mod>
18:04:03   Error position: <# 2))}),QS_system_AI_owners];
};
_QS_mod>
18:04:03   Error #: Type Number, expected Array
18:04:03 File mpmissions\__cur_mp.Altis\code\functions\fn_AI.sqf..., line 2274

Potential Cause

Based on what I could gather, a bug was introduced in commit f002d94 (version 1.3.0) within the file fn_AIHandleGroup.sqf on line 744 where during an artillery request, instead of a single array being pushed into QS_AI_fireMissions, its individual elements are added instead:

https://github.com/auQuiksilver/Apex-Framework/blob/f8b944f6277c5c05e9b0259897469f4ef158a72a/Apex_framework.terrain/code/functions/fn_AIHandleGroup.sqf#L744

(The line above is still present in the currently latest commit, f8b944f (version 1.3.2))

This appears to be consistent with my debugging attempts when server executing the following code in the Dev Terminal, showing the variable was set to [[7150,15450,0],50,9368.98]:

[str QS_AI_fireMissions] remoteExec ['systemChat',remoteExecutedOwner];

I have yet to test a solution but it should just involve adding a couple more square brackets around [_firePosition,50,(serverTime + 45)] so it behaves more like the pushBack command that was written prior to the commit.

auQuiksilver commented 2 years ago

Excellent find thank you. That is indeed incorrect syntax, + needs an extra set of brackets compared to pushBack.

The bug will only appear when the Artilley priority target is active. There is no way to resolve this from parameters.sqf so until i can commit/merge a fix (mid october), admins will have to manually fix this one.

auQuiksilver commented 2 years ago

This is resolved for 1.3.3