ALiVEOS/ALiVE.OS

Sometimes MACC keeps throwing an error about _takeoff being undefined.

romabysen opened this issue · 4 comments

Prerequisites

  • Can you reproduce the problem using ALiVE and CBA Only?
  • Are you running the latest version of ALiVE ?
  • Are you running the latest version of CBA_A3?
  • Have you attached an unbinarized SQM?
  • Have you attached your RPT (If the issue relates to data, also attch Server RPT and ALiVE Plugin Log)?
  • Have you attached screenshots of the Parameters set on the offending Module?

Description

On the rare occasion MACC starts throwing errors about _takeoff being undefined. As for know I do not know if this affects the game.

Steps to Reproduce

Sorry, it doesn't happen at a frequency where it is reliably reproducible.
alive_takeoff_issue.txt
Screenshot 2022-08-30 220521

As far as I can gather this is a race condition or timing issue so maybe a slight delay of the MACC init could solve it.

Thinking more about this, discarding/cancelling the air mission if _targetProfile is nil on line 3806 in fnc_ATO.sqf seems to be a reasonable solution.

I'm currently working on something else for Alive but if it's that simple, I will have a look tomorrow, trace any possible side effects and submit a code change and pull request if everyone else is busy.

I had a look at the code yesterday and instead of cancelling or discarding, I think I found a simple solution. _eventPosition is already defined as the marker position. It just is trying to locate specific target positions and either it is sent no targets or bad target data. Not sure which. I just added a check if _targetProfile is null to fall back and keep _eventPosition as marker position.