Fix connot execute quest command in console

This commit is contained in:
zrll_ 2022-05-14 15:12:57 +08:00 committed by Melledy
parent 383dfda131
commit c3ff2b81ec

View File

@ -37,7 +37,7 @@ public final class QuestCommand implements CommandHandler {
switch (cmd) {
case "add" -> {
GameQuest quest = sender.getQuestManager().addQuest(questId);
GameQuest quest = targetPlayer.getQuestManager().addQuest(questId);
if (quest != null) {
CommandHandler.sendMessage(sender, translate(sender, "commands.quest.added", questId));
@ -47,7 +47,7 @@ public final class QuestCommand implements CommandHandler {
CommandHandler.sendMessage(sender, translate(sender, "commands.quest.not_found"));
}
case "finish" -> {
GameQuest quest = sender.getQuestManager().getQuestById(questId);
GameQuest quest = targetPlayer.getQuestManager().getQuestById(questId);
if (quest == null) {
CommandHandler.sendMessage(sender, translate(sender, "commands.quest.not_found"));