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

addClassEH - Handle respawning units #622

Merged
merged 1 commit into from
Mar 20, 2017
Merged

Conversation

PabstMirror
Copy link
Contributor

Ref acemod/ACE3#5005

Add class event handler fails if the unit is dead and in the process of respawning,

To reproduce:

addMissionEventHandler ["EntityKilled", {
    ["CAManBase", "fired", {systemChat str _this}] call CBA_fnc_addClassEventHandler;
}];

Put in init.sqf and hit respawn in MP.

@PabstMirror PabstMirror added this to the 3.3 milestone Mar 20, 2017
@commy2
Copy link
Contributor

commy2 commented Mar 20, 2017

But if the unit respawns, it does not trigger the init eventhandler again. How does this fix anything?
And why does it fail in the first place?

@commy2
Copy link
Contributor

commy2 commented Mar 20, 2017

respawnTime = 0; or >0 ?

@commy2
Copy link
Contributor

commy2 commented Mar 20, 2017

Found the problem:

addMissionEventHandler ["EntityKilled", {
    params ["_corpse"]; 
    _entities = entities [[], [], true, true];
    hint str (_corpse in _entities); 
}]; 

Reports false.
Apprently the fourth argument, flag is excludeDead, not "includeDead". Oops.

@commy2 commy2 merged commit a91243b into master Mar 20, 2017
@commy2 commy2 deleted the fixClassEHforRespawns branch March 20, 2017 14:10
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 this pull request may close these issues.

None yet

2 participants