mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-07 10:36:41 +01:00
Slight change on synchronization method. (#2135)
This commit is contained in:
@@ -178,14 +178,16 @@ public class GameQuest {
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized void finish() {
|
||||
public void finish() {
|
||||
// Check if the quest has been finished.
|
||||
if (this.state == QuestState.QUEST_STATE_FINISHED) {
|
||||
Grasscutter.getLogger().debug("Quest {} was already finished.", this.getSubQuestId());
|
||||
return;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.state == QuestState.QUEST_STATE_FINISHED) {
|
||||
Grasscutter.getLogger().debug("Quest {} was already finished.", this.getSubQuestId());
|
||||
return;
|
||||
}
|
||||
|
||||
this.state = QuestState.QUEST_STATE_FINISHED;
|
||||
this.state = QuestState.QUEST_STATE_FINISHED;
|
||||
}
|
||||
this.finishTime = Utils.getCurrentSeconds();
|
||||
|
||||
this.getOwner().sendPacket(new PacketQuestListUpdateNotify(this));
|
||||
|
||||
Reference in New Issue
Block a user