mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 03:32:53 +08:00
Fix changing time + Trigger time change condition
This commit is contained in:
parent
312c98ee19
commit
8bb7ae22d0
@ -331,6 +331,12 @@ public class Player {
|
|||||||
if (this.playerGameTime == gameTime) return;
|
if (this.playerGameTime == gameTime) return;
|
||||||
this.playerGameTime = gameTime;
|
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();
|
this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@ public class HandlerSkipPlayerGameTimeReq extends PacketHandler {
|
|||||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
var req = SkipPlayerGameTimeReqOuterClass.SkipPlayerGameTimeReq.parseFrom(payload);
|
var req = SkipPlayerGameTimeReqOuterClass.SkipPlayerGameTimeReq.parseFrom(payload);
|
||||||
var player = session.getPlayer();
|
var player = session.getPlayer();
|
||||||
player.updatePlayerGameTime(req.getGameTime());
|
|
||||||
|
var newTime = req.getGameTime() * 1000L;
|
||||||
|
player.updatePlayerGameTime(newTime);
|
||||||
player.getScene().broadcastPacket(new PacketPlayerGameTimeNotify(player));
|
player.getScene().broadcastPacket(new PacketPlayerGameTimeNotify(player));
|
||||||
player.sendPacket(new PacketSkipPlayerGameTimeRsp(req));
|
player.sendPacket(new PacketSkipPlayerGameTimeRsp(req));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user