From 369e654772e4e90bef4d99de1eeac4d02b9a9e24 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 23:10:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E4=BA=86=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=A1=86=E5=92=8C=E8=81=8A=E5=A4=A9=E6=A1=86=E5=BE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/user.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/public/user.ts b/src/public/user.ts index e74bce3..b66308d 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -297,8 +297,7 @@ export class UserFun { if (val == -1 && !gud.headFrames[conf.id]) { change = true; gud.headFrames[conf.id] = -1; - } - else if (val >= 0) { + } else if (val > 0 && gud.headFrames[conf.id] != -1) { change = true; gud.headFrames[conf.id] = G.time + val * v; } @@ -339,15 +338,16 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1 && !gud.headFrames[conf.id]) { + if (val == -1 && !gud.chatFrames[conf.id]) { change = true; - gud.headFrames[conf.id] = -1; - } else if (val >= 0) { + gud.chatFrames[conf.id] = -1; + } else if (val > 0 && gud.chatFrames[conf.id] != -1) { change = true; - gud.headFrames[conf.id] = G.time + val * v; + gud.chatFrames[conf.id] = G.time + val * v; } } } + if (change) { PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames}); @@ -382,13 +382,15 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1 && !gud.headFrames[conf.id]) { + if (val == -1) { change = true; - gud.headFrames[conf.id] = -1; - } - else if (val >= 0) { + gud.model[conf.id] = {id: conf.id + '', time: -1}; + } else if (gud.model[conf.id].time < G.time) { change = true; - gud.headFrames[conf.id] = G.time + val * v; + gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v}; + } else { + change = true; + gud.model[conf.id] = {id: conf.id + '', time: gud.model[conf.id].time += val * v} } } }