mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-20 14:31:24 +01:00
Hooks: Fix recursive adding to mappings.
This commit is contained in:
parent
d2d4517612
commit
ba6e2e5a5d
@ -128,16 +128,22 @@ public final class NCPHookManager {
|
|||||||
* @param checkType
|
* @param checkType
|
||||||
* @param refType
|
* @param refType
|
||||||
* @param hook
|
* @param hook
|
||||||
|
* @return If the
|
||||||
*/
|
*/
|
||||||
private static void addToMappingsRecursively(final CheckType checkType, CheckType refType, final NCPHook hook) {
|
private static boolean addToMappingsRecursively(final CheckType checkType, final CheckType refType, final NCPHook hook) {
|
||||||
if (refType.group == null)
|
if (refType.group == null)
|
||||||
return;
|
return false;
|
||||||
else if (refType.group == checkType){
|
else if (refType.group == checkType){
|
||||||
addToMapping(refType, hook);
|
addToMapping(refType, hook);
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
addToMappingsRecursively(checkType, refType.group, hook);
|
if (addToMappingsRecursively(checkType, refType.group, hook)){
|
||||||
|
addToMapping(refType, hook);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user