From 00ed2524031c72818f45f4519d56df2230bab05c Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 15:10:54 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=E5=A4=B4=E5=83=8F=E6=A1=86=20?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E6=A1=86=EF=BC=8C=E9=80=A0=E5=9E=8B=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3e43065142de632994f50e59e48430deecc8de93. --- src/public/user.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/public/user.ts b/src/public/user.ts index aedad8a..b66308d 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -298,17 +298,12 @@ export class UserFun { change = true; gud.headFrames[conf.id] = -1; } else if (val > 0 && gud.headFrames[conf.id] != -1) { - } - else if (val >= 0) { change = true; gud.headFrames[conf.id] = G.time + val * v; } } - else if(conf?.cond?.[0] == "jjc_rank") { - change = true; - gud.headFrames[conf.id] = -1; - } } + if (change) { PlayerFun.changeAttr(uid, {headFrames: gud.headFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {headFrames: gud.headFrames}); @@ -343,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}); @@ -386,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} } } }