Fix changing time + Trigger time change condition

This commit is contained in:
KingRainbow44 2023-05-04 01:05:03 -04:00
parent 312c98ee19
commit 8bb7ae22d0
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
2 changed files with 9 additions and 1 deletions

View File

@ -331,6 +331,12 @@ public class Player {
if (this.playerGameTime == gameTime) return;
this.playerGameTime = gameTime;
// Trigger the script event for game time update.
var questManager = this.getQuestManager();
questManager.queueEvent(QuestCond.QUEST_COND_IS_DAYTIME);
questManager.queueEvent(QuestCond.QUEST_COND_TIME_VAR_GT_EQ);
questManager.queueEvent(QuestCond.QUEST_COND_TIME_VAR_PASS_DAY);
this.save();
}

View File

@ -14,7 +14,9 @@ public class HandlerSkipPlayerGameTimeReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var req = SkipPlayerGameTimeReqOuterClass.SkipPlayerGameTimeReq.parseFrom(payload);
var player = session.getPlayer();
player.updatePlayerGameTime(req.getGameTime());
var newTime = req.getGameTime() * 1000L;
player.updatePlayerGameTime(newTime);
player.getScene().broadcastPacket(new PacketPlayerGameTimeNotify(player));
player.sendPacket(new PacketSkipPlayerGameTimeRsp(req));
}