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

Zeus - Fix trench module on clients #9513

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Zeus - Fix trench module on clients #9513

merged 2 commits into from
Oct 19, 2023

Conversation

PabstMirror
Copy link
Contributor

TRACE: 92958 moduleLayTrench: _logic=L Alpha 1-2:1, _logic getVariable "test"=any z\ace\addons\zeus\functions\fnc_moduleLayTrench.sqf:23
TRACE: 92962 moduleLayTrench: _logic=L ACE Utility:1, _logic getVariable "test"=92958 z\ace\addons\zeus\functions\fnc_moduleLayTrench.sqf:23

I put one module down on a client and get function runs twice for the same module, separated by ~5 frames?
I have no idea why

@PabstMirror
Copy link
Contributor Author

Might be due to BIS_fnc_moduleInit and BIS_fnc_moduleExecute
I think it's doing

	if (ismultiplayer && _isGlobal && !is3DEN && time > 0) then {		
		[_arguments,_function,-2] spawn BIS_fnc_MP; 
	};	
	_arguments spawn (missionnamespace getvariable _function);

so the server runs it once and every other client runs it twice
once normally and a 2nd time after network delay, which would match the 5 frames I'm seeing
wtf, or am I reading this wrong?

@mharis001
Copy link
Member

Yes, you are correct. BI's module framework has been bugged since the start and is the main reason why ZEN adds its own module initialization function.

@veteran29
Copy link
Member

I'm not even sure why our Zeus modules are global.

@PabstMirror PabstMirror marked this pull request as ready for review October 18, 2023 16:56
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Oct 18, 2023
@PabstMirror
Copy link
Contributor Author

we need global because we need the func to run on zues's machine
I guess we can add run-guards on every zeus func
but in most cases they are deleted right away so it didn't matter

@PabstMirror PabstMirror added this to the 3.16.1 milestone Oct 18, 2023
@PabstMirror PabstMirror merged commit e3f447c into master Oct 19, 2023
@PabstMirror PabstMirror deleted the moduleWeird branch October 19, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants