From 3b7f3471b411a18cb74d8d784386ef8fb4a6e34f Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Wed, 17 Apr 2019 22:56:42 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E8=B7=9F=E9=9A=8F=E8=80=85=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/ui.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libs/ui.js b/libs/ui.js index e6e9baf7..e689ef59 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -403,9 +403,9 @@ ui.prototype._getPosition = function (content) { py = core.status.event.data.y; } content = content.replace("\b", "\\b") - .replace(/\\b\[(up|center|down|hero|null)(,(hero|null|\d+,\d+|\d+))?]/g, function (s0, s1, s2, s3) { + .replace(/\\b\[(up|center|down|hero|null)(,(hero|null|\d+,\d+))?]/g, function (s0, s1, s2, s3) { pos = s1; - if (s3 == 'hero' || s1=='hero' && !s3) { + if (s3 == 'hero' || s1=='hero') { px = core.status.hero.loc.x; py = core.status.hero.loc.y; } @@ -414,14 +414,8 @@ ui.prototype._getPosition = function (content) { } else if (s3) { var str = s3.split(','); - if(str.length==1){ - var follower = (core.status.hero.followers||{})[parseInt(str[0])-1]||{}; - px = follower.x || null; - py = follower.y || null; - }else{ - px = parseInt(str[0]); - py = parseInt(str[1]); - } + px = parseInt(str[0]); + py = parseInt(str[1]); } if(pos=='hero' || pos=='null'){ pos = py==null?'center':(py>=core.__HALF_SIZE__? 'up':'down');