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

onRespawn does not work with InitPost XEH #318

Closed
PabstMirror opened this issue Apr 26, 2016 · 0 comments
Closed

onRespawn does not work with InitPost XEH #318

PabstMirror opened this issue Apr 26, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@PabstMirror
Copy link
Contributor

class Extended_Init_EventHandlers {
    class CAManBase {
        class AAA {
            init ="diag_log text format ['X: init [%1]',_this];";
        };
        class BBB {
            onRespawn = 1;
            init ="diag_log text format ['X: init onRespawn [%1]',_this];";
        };
    };
};
class Extended_InitPost_EventHandlers {
    class CAManBase {
        class CCC {
            init ="diag_log text format ['X: InitPost [%1]',_this];";
        };
        class DDD {
            onRespawn = 1;
            init ="diag_log text format ['X: InitPost onRespawn [%1]',_this];";
        };
    };
};

After respawning:

CBA 2.2:
X: init onRespawn [[B Alpha 1-1:1 (Pabst Mirror)]]
X: InitPost [[B Alpha 1-1:1 (Pabst Mirror)]]
X: InitPost onRespawn [[B Alpha 1-1:1 (Pabst Mirror)]]

Current CBA:
X: init onRespawn [[B Alpha 1-1:1 (Pabst Mirror),56a40080# 163957: b_soldier_01.p3d]]

I am not sure why the non-respawn InitPost ran in 2.2. But I'm fairly sure we do want to run on the onRespawn version.

https://github.com/CBATeam/CBA_A3/blob/master/addons/xeh/fnc_compileEventHandlers.sqf#L156

Should we change line 156 to
if (((_eventName == "init") || {_eventName == "initPost"}) && {getNumber (_x >> "onRespawn") == 1}) then {

@commy2 commy2 closed this as completed in d682428 Apr 30, 2016
commy2 added a commit that referenced this issue Apr 30, 2016
fix onRespawn not working with initPost event, fix #318
@commy2 commy2 added this to the 2.4.0 milestone May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants