Skip to content

Undefined variables _thisEvent and _thisEventHandlerΒ #1089

@Timi007

Description

@Timi007

Tools (complete and add to the following information):

  • HEMTT: 1.17.2
  • Operating System: Windows 11

Description:
The magic variables _thisEvent and _thisEventHandler are flagged as undefined when they are used inside a function file that is not the same file as the eventhandler caller.

help[L-S13]: Undefined variable `_thisEvent`
  β”Œβ”€ addons/main/functions/fnc_onDraw.sqf:3:28
  β”‚
3 β”‚ removeMissionEventHandler [_thisEvent, _thisEventHandler];
  β”‚                            ^^^^^^^^^^ undefined variable

help[L-S13]: Undefined variable `_thisEventHandler`
  β”Œβ”€ addons/main/functions/fnc_onDraw.sqf:3:40
  β”‚
3 β”‚ removeMissionEventHandler [_thisEvent, _thisEventHandler];
  β”‚                                        ^^^^^^^^^^^^^^^^^ undefined variable

Steps to reproduce:

  1. Create a CBA/ACE project with 2 function files, as shown in the example repo: fnc_addDrawEH.sqf and fnc_onDraw.sqf.
  2. Build the project
  3. Both _thisEvent and _thisEventHandler are flagged as undefined variables

Expected behavior:
Magic variables should not be flagged as unused variables.

Logs:

Additional context:
This might be related to the CBA/ACE project structure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions