-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add variable name exclusion for objects #121
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,9 +89,16 @@ GVAR(PFHObject) = [ | |
| { | ||
| private _justInitialized = false; | ||
| if !(_x getVariable [QGVARMAIN(isInitialized), false]) then { | ||
| if ( | ||
| _x isKindOf "Logic" | ||
| ) exitWith { | ||
| if (_x isKindOf "Logic") exitWith { | ||
| _x setVariable [QGVARMAIN(exclude), true, true]; | ||
| _x setVariable [QGVARMAIN(isInitialized), true, true]; | ||
| }; | ||
| // Check pre-set OCAP_main_exclude variable for per-object exclusion via editor init field | ||
| if (_x getVariable [QGVARMAIN(exclude), false]) exitWith { | ||
| _x setVariable [QGVARMAIN(isInitialized), true, true]; | ||
| }; | ||
| // Check vehicleVarName against centralized exclude list | ||
| if (GVAR(excludeVarNameList) isNotEqualTo [] && {vehicleVarName _x in GVAR(excludeVarNameList)}) exitWith { | ||
| _x setVariable [QGVARMAIN(exclude), true, true]; | ||
| _x setVariable [QGVARMAIN(isInitialized), true, true]; | ||
| }; | ||
|
Comment on lines
+101
to
104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If Additionally, calling We should check |
||
|
|
@@ -204,6 +211,15 @@ GVAR(PFHObject) = [ | |
| { | ||
| private _justInitialized = false; | ||
| if !(_x getVariable [QGVARMAIN(isInitialized), false]) then { | ||
| // Check pre-set OCAP_main_exclude variable for per-object exclusion via editor init field | ||
| if (_x getVariable [QGVARMAIN(exclude), false]) exitWith { | ||
| _x setVariable [QGVARMAIN(isInitialized), true, true]; | ||
| }; | ||
| // Check vehicleVarName against centralized exclude list | ||
| if (GVAR(excludeVarNameList) isNotEqualTo [] && {vehicleVarName _x in GVAR(excludeVarNameList)}) exitWith { | ||
| _x setVariable [QGVARMAIN(exclude), true, true]; | ||
| _x setVariable [QGVARMAIN(isInitialized), true, true]; | ||
| }; | ||
|
Comment on lines
+219
to
+222
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the unit loop, if Checking |
||
| _vehType = typeOf _x; | ||
| _class = _vehType call FUNC(getClass); | ||
| private _vic = _x; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exiting early here for excluded units without sending the
:SOLDIER:CREATE:event introduces a critical bug when players are involved.OCAP's design forces player units to always be tracked (lines 135-139 un-exclude any unit where
isPlayer _xis true). If a player unit (or a playable AI unit that a player slots into later) is excluded at initialization, it will be marked asisInitialized = truebut:SOLDIER:CREATE:will never be sent. When the player is un-excluded, OCAP will start sending:SOLDIER:STATE:updates for an ID that was never created, leading to database errors or broken AAR playbacks.To fix this:
!isPlayer _xto the exclusion checks.isInitializedtofalsewhen they are un-excluded so they can be properly initialized on the next frame.Since lines 135-139 are outside this diff hunk, you should update them manually as follows: