Fix bug in quest cond state not equal (#2393)

* Fix bug in ConditionStateNotEqual.java

* Do the same fix for ConditionStateEqual.java
This commit is contained in:
Nazrin 2023-10-02 00:25:35 -07:00 committed by GitHub
parent cf574e99cb
commit cab3bfb5a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,9 @@ public class ConditionStateEqual extends BaseCondition {
var questStateValue = condition.getParam()[1]; var questStateValue = condition.getParam()[1];
var checkQuest = owner.getQuestManager().getQuestById(questId); var checkQuest = owner.getQuestManager().getQuestById(questId);
return checkQuest != null && checkQuest.getState().getValue() == questStateValue; if (checkQuest == null) {
return questStateValue == 0;
}
return checkQuest.getState().getValue() == questStateValue;
} }
} }

View File

@ -20,6 +20,9 @@ public class ConditionStateNotEqual extends BaseCondition {
var questStateValue = condition.getParam()[1]; var questStateValue = condition.getParam()[1];
var checkQuest = owner.getQuestManager().getQuestById(questId); var checkQuest = owner.getQuestManager().getQuestById(questId);
return checkQuest != null && checkQuest.getState().getValue() != questStateValue; if (checkQuest == null) {
return questStateValue != 0;
}
return checkQuest.getState().getValue() != questStateValue;
} }
} }