mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-23 23:32:58 +08:00
Add debug property to log missing ability actions
This commit is contained in:
parent
93460ab0aa
commit
bf3e390ce6
@ -6,6 +6,7 @@ public final class DebugConstants {
|
|||||||
public static boolean LOG_QUEST_START = false;
|
public static boolean LOG_QUEST_START = false;
|
||||||
public static boolean LOG_MISSING_ABILITIES = false;
|
public static boolean LOG_MISSING_ABILITIES = false;
|
||||||
public static boolean LOG_MISSING_LUA_SCRIPTS = false;
|
public static boolean LOG_MISSING_LUA_SCRIPTS = false;
|
||||||
|
public static boolean LOG_MISSING_ABILITY_HANDLERS = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WARNING: THIS IS A DANGEROUS SETTING. DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING.
|
* WARNING: THIS IS A DANGEROUS SETTING. DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING.
|
||||||
|
@ -91,9 +91,9 @@ public final class AbilityManager extends BasePlayerManager {
|
|||||||
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
|
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
|
||||||
var handler = actionHandlers.get(action.type);
|
var handler = actionHandlers.get(action.type);
|
||||||
if (handler == null || ability == null) {
|
if (handler == null || ability == null) {
|
||||||
if (DebugConstants.LOG_ABILITIES) {
|
if (DebugConstants.LOG_MISSING_ABILITY_HANDLERS) {
|
||||||
Grasscutter.getLogger()
|
Grasscutter.getLogger()
|
||||||
.debug("Could not execute ability action {} at {}", action.type, ability);
|
.debug("Missing ability action handler for {} (invoker: {}).", action.type, ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -103,7 +103,7 @@ public final class AbilityManager extends BasePlayerManager {
|
|||||||
() -> {
|
() -> {
|
||||||
if (!handler.execute(ability, action, abilityData, target)) {
|
if (!handler.execute(ability, action, abilityData, target)) {
|
||||||
Grasscutter.getLogger()
|
Grasscutter.getLogger()
|
||||||
.debug("Ability execute action failed for {} at {}.", action.type, ability);
|
.debug("Ability execute action failed for {} at {}.", action.type, ability);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user