-
Notifications
You must be signed in to change notification settings - Fork 156
Add naked unit bug workaround #1406
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e0b2500
Add naked unit fix
Kexanone 1614e39
Add event handler to config
Kexanone 9ca6b6a
Handle rogue trigger of local
Kexanone 65cc50d
Remove superfluous setVariable
Kexanone 69c6d08
Fix case
Kexanone 6741b9e
Rename variables
Kexanone a938e63
Refactor code
Kexanone e705d26
Make loadout validation optional
Kexanone d7d5266
Fix localization
Kexanone 145733b
Reset wasLocal
Kexanone 37449af
Make validateLoadout event switchable
Kexanone 588ef55
Fix syntax
Kexanone d2a3c66
Make setting global
Kexanone 19cd902
Update initSettings.sqf
Kexanone d4363cc
Add option for playable units
Kexanone 0c9416d
Update addons/network/initSettings.sqf
Kexanone cff48f7
Update addons/network/XEH_preInit.sqf
Kexanone 43bc78f
Update addons/network/XEH_preInit.sqf
Kexanone e1c0356
Update addons/network/XEH_preInit.sqf
Kexanone 68565c1
Revise playableUnits condition
Kexanone bcebe93
remove superfluous parentheses
commy2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class Extended_PreInit_EventHandlers { | ||
| class ADDON { | ||
| init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| ADDON = false; | ||
|
|
||
| #include "initSettings.sqf" | ||
|
|
||
| // Restore loadouts lost by the naked unit bug | ||
| [QGVAR(validateLoadout), { | ||
| params ["_unit", "_loadout"]; | ||
|
|
||
| if (GVAR(loadoutValidation) > 0 && {getUnitLoadout _unit isNotEqualTo _loadout}) then { | ||
| _unit setUnitLoadout _loadout; | ||
| }; | ||
| }] call CBA_fnc_addEventHandler; | ||
|
|
||
| ["CAManBase", "Local", { | ||
|
Kexanone marked this conversation as resolved.
|
||
| params ["_unit", "_local"]; | ||
| if !(_local) then { | ||
| // Broadcast loadout to new owner if unit was once local on this machine | ||
| if (GVAR(loadoutValidation) > 0 && {_unit getVariable [QGVAR(wasLocal), false]}) then { | ||
| if (GVAR(loadoutValidation) == 1 && {!(_unit in playableUnits)}) exitWith {}; | ||
| private _loadout = getUnitLoadout _unit; | ||
| [QGVAR(validateLoadout), [_unit, _loadout], _unit] call CBA_fnc_targetEvent; | ||
| }; | ||
|
Kexanone marked this conversation as resolved.
|
||
| }; | ||
| _unit setVariable [QGVAR(wasLocal), _local]; | ||
| }] call CBA_fnc_addClassEventHandler; | ||
|
|
||
| ["CAManBase", "Init", { | ||
| params ["_unit"]; | ||
| if (local _unit) then { | ||
| _unit setVariable [QGVAR(wasLocal), true]; | ||
| }; | ||
|
commy2 marked this conversation as resolved.
|
||
| }] call CBA_fnc_addClassEventHandler; | ||
|
|
||
| ADDON = true; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,5 @@ class CfgPatches { | |
| }; | ||
| }; | ||
|
|
||
| #include "CfgEventHandlers.hpp" | ||
| #include "CfgFunctions.hpp" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [ | ||
| QGVAR(loadoutValidation), | ||
| "LIST", | ||
| [LLSTRING(LoadoutValidation), LLSTRING(LoadoutValidationTooltip)], | ||
| LSTRING(Component), | ||
| [ | ||
| [0, 1, 2], | ||
| [ | ||
| [LLSTRING(NeverValidate), LLSTRING(NeverValidateTooltip)], | ||
| [LLSTRING(ValidatePlayableOnly), LLSTRING(ValidatePlayableOnlyTooltip)], | ||
| [LLSTRING(ValidateAll), LLSTRING(ValidateAllTooltip)] | ||
| ], | ||
| 0 // Disabled by default | ||
| ], | ||
| 1 // Forced on all machines by default | ||
| ] call CBA_fnc_addSetting; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.