mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-26 09:21:40 +01:00
Fix Denizen scripts not running if quest has multiple stages, fixes #931
This commit is contained in:
parent
f8fa9dc57c
commit
50a73bb463
@ -174,26 +174,19 @@ public class Quest {
|
|||||||
q.findCompassTarget();
|
q.findCompassTarget();
|
||||||
}
|
}
|
||||||
if (q.getCurrentStage(this).delay < 0) {
|
if (q.getCurrentStage(this).delay < 0) {
|
||||||
|
if (q.getCurrentStage(this).finishEvent != null) {
|
||||||
|
q.getCurrentStage(this).finishEvent.fire(q, this);
|
||||||
|
}
|
||||||
if (q.currentQuests.get(this) == (orderedStages.size() - 1)) {
|
if (q.currentQuests.get(this) == (orderedStages.size() - 1)) {
|
||||||
if (q.getCurrentStage(this).script != null) {
|
if (q.getCurrentStage(this).script != null) {
|
||||||
plugin.getDenizenTrigger().runDenizenScript(q.getCurrentStage(this).script, q);
|
plugin.getDenizenTrigger().runDenizenScript(q.getCurrentStage(this).script, q);
|
||||||
}
|
}
|
||||||
if (q.getCurrentStage(this).finishEvent != null) {
|
|
||||||
q.getCurrentStage(this).finishEvent.fire(q, this);
|
|
||||||
}
|
|
||||||
completeQuest(q);
|
completeQuest(q);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if (q.getCurrentStage(this).finishEvent != null) {
|
|
||||||
q.getCurrentStage(this).finishEvent.fire(q, this);
|
|
||||||
}
|
|
||||||
setStage(q, q.currentQuests.get(this) + 1);
|
setStage(q, q.currentQuests.get(this) + 1);
|
||||||
} catch (InvalidStageException e) {
|
|
||||||
e.printStackTrace();
|
// Multiplayer
|
||||||
}
|
|
||||||
|
|
||||||
// Multiplayer
|
|
||||||
try {
|
|
||||||
if (opts.getShareProgressLevel() == 3) {
|
if (opts.getShareProgressLevel() == 3) {
|
||||||
List<Quester> mq = q.getMultiplayerQuesters(this);
|
List<Quester> mq = q.getMultiplayerQuesters(this);
|
||||||
if (mq != null) {
|
if (mq != null) {
|
||||||
@ -239,7 +232,7 @@ public class Quest {
|
|||||||
quester.hardStagePut(this, stage);
|
quester.hardStagePut(this, stage);
|
||||||
quester.addEmptiesFor(this, stage);
|
quester.addEmptiesFor(this, stage);
|
||||||
if (currentStage.script != null) {
|
if (currentStage.script != null) {
|
||||||
plugin.getDenizenTrigger().runDenizenScript(quester.getCurrentStage(this).script, quester);
|
plugin.getDenizenTrigger().runDenizenScript(currentStage.script, quester);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* if (quester.getCurrentStage(this).finishEvent != null) { quester.getCurrentStage(this).finishEvent.fire(quester); }
|
* if (quester.getCurrentStage(this).finishEvent != null) { quester.getCurrentStage(this).finishEvent.fire(quester); }
|
||||||
|
Loading…
Reference in New Issue
Block a user