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

XEH initPost runs twice when added retroactively via function #567

Closed
kymckay opened this issue Dec 21, 2016 · 10 comments · Fixed by #736
Closed

XEH initPost runs twice when added retroactively via function #567

kymckay opened this issue Dec 21, 2016 · 10 comments · Fixed by #736
Labels
Milestone

Comments

@kymckay
Copy link
Contributor

kymckay commented Dec 21, 2016

Arma 3 Version: 1.66 (stable)
CBA Version: 3.1.2 (dev 311d8d7)

Mods:

  • \x\cba
  • \z\ace
  • @devcon_a3 (in-house dev console that I always run while developing)

Description:

  • When using function CBA_fnc_addClassEventHandler to add an "initPost" XEH to a vehicle with the retroactive parameter set to true, the event will run twice for existing instances of that vehicle.

Steps to reproduce:
Run the following repro mission:
EmptyMission.VR.zip

You can see I've added an initPost EH to CAManBase (player unit) both via the CBA_fnc_addClassEventHandler function and via the Extended_InitPost_EventHandlers in description.ext

The config version runs only once, while the scripted version runs twice.

Where did the issue occur?

  • Editor (Singleplayer)

RPT log file:

@commy2
Copy link
Contributor

commy2 commented Dec 21, 2016

Does this always happen regardless of when the eventhandler is used? preInit vs. postInit vs. mid mission / scheduled init.sqf?

@kymckay
Copy link
Contributor Author

kymckay commented Dec 21, 2016

Currently only tested from postInit, will try init.sqf and preInit also

@kymckay
Copy link
Contributor Author

kymckay commented Dec 21, 2016

It only runs once from both preInit and init.sqf, so it seems to only be an issue when added during postInit

@commy2
Copy link
Contributor

commy2 commented Dec 21, 2016

Very interesting. That narrows down the problem alot.

@commy2
Copy link
Contributor

commy2 commented Jan 16, 2017

hijacking this for a note:

  • decouple CBA postInit from BI postInit to avoid getting stalled with waitUntil

@PabstMirror
Copy link
Contributor

(entities [[], [], true, true]) returns duplicates of units in vehicles when called at postInit

AI_2 starts in a car, listed twice
[L Modules:1,AI_2,aCar,startingPlayer,AI_1,AI_2]

@commy2
Copy link
Contributor

commy2 commented Jan 18, 2017

So that is all? That fixes this issue? Dammit BI.

@commy2 commy2 added this to the 3.2 milestone Jan 18, 2017
@Dystopian
Copy link
Contributor

looks like this is not fixed

2:13:47 "Scripted initPost ran"
2:13:47 "Config initPost ran"
2:13:47 "Scripted initPost ran"

@commy2
Copy link
Contributor

commy2 commented Aug 18, 2017

Repro?

@Dystopian
Copy link
Contributor

EmptyMission.VR.zip
this is simplified @SilentSpike mission, it can be tested with CBA only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants