Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit 36f9f50

Browse files
committed
bug fix + small optimization
1 parent 1d12ea7 commit 36f9f50

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

StreamRaidersBot/Bot/src/program/Configs.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,11 @@ public static void syncProfile(String cid, String defCid, ProfileType pt) {
15791579
if(getUnitInfoStr(defCid, uId, fromProfile).equals(cid))
15801580
remUnitId(defCid, pt, uId);
15811581
} else {
1582+
// unsync if it already was synced before
1583+
String sync_before = getPStr(cid, syncProfile);
1584+
if(!sync_before.equals("(none)"))
1585+
syncProfile(cid, null, pt);
1586+
15821587
// sync
15831588
JsonObject def = getProfile(defCid);
15841589
setPStr(cid, syncProfile, defCid);

StreamRaidersBot/Bot/src/run/Viewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ public void run() {
672672
Configs.getFavCaps(cid, currentLayer, dungeon ? Configs.dungeon : Configs.campaign).contains(r.get(SRC.Raid.twitchDisplayName)), slot, vbe.getSkins(), r.get(SRC.Raid.captainId));
673673

674674
if(pla == null) {
675-
Logger.print("Place=null", Logger.units, Logger.info, cid, slot);
675+
Logger.print("place=null", Logger.units, Logger.info, cid, slot);
676676
System.out.println("place=null, "+Configs.getPStr(cid, Configs.pname)+" - "+slot);
677677
break;
678678
}

StreamRaidersBot/GraphicalUserInterface/src/userInterface/MapGUI.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import program.Heatmap;
99
import program.Map;
1010
import program.SRC;
11+
import program.Unit;
1112
import run.Viewer;
1213

1314
import java.awt.Color;
@@ -268,9 +269,11 @@ else if(map.is(x, y, SRC.Map.isOther))
268269
l.setText("X");
269270
} else {
270271
JsonElement uType = map.get(x, y).get("unitType");
272+
String ut = null;
271273
if(uType != null)
272-
l.setText(getShortenedUnitAndPlanType(uType.getAsString()));
273-
l.setTooltip(map.getUserName(x, y));
274+
l.setText(getShortenedUnitAndPlanType(ut = uType.getAsString()));
275+
276+
l.setTooltip(map.getUserName(x, y) + (ut==null?"":" - "+Unit.getName(ut)));
274277

275278
}
276279
l.setFont(new Font(Font.SERIF, Font.PLAIN, 10));

StreamRaidersBot/data/opt.txt

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)