Sign in to follow this  
thorgot

Examining an epic monument displays everybody who has ever helped on a mission instead of those who helped with that monument

Recommended Posts

As the title says, when you examine a completed epic monument you get a list of everybody who has ever worked on any mission. This is thousands of accounts, making it next-to-impossible to find out who actually built the specific monument you're looking at. Easy fix, just print out those with helps > 0.

 

A related bug is that the % listed next to each name is off by a factor of 100. For example, Gatwick alone built this monument I'm standing next to and is listed as Gatwick: 984 (1.0%). The fix for this is also easy, multiplying the value printed for % by 100.

 

Current code in SimplePopup looks like:

for (final MissionHelper helper : MissionHelper.getHelpers().values()) {
  final int i = helper.getHelps(this.missionId);
  final PlayerInfo pinf = PlayerInfoFactory.getPlayerInfoWithWurmId(helper.getPlayerId());
  if (pinf != null) {
    buf.append("text{text=\"" + pinf.getName() + ": " + i + " (" + i / this.maxHelps + "%) \"}");
  }
  else {
    buf.append("text{text=\"Unknown: " + i + " (" + i / this.maxHelps + "%) \"}");
  }
}

Fixed looks like:

for (final MissionHelper helper : MissionHelper.getHelpers().values()) {
  final int i = helper.getHelps(this.missionId);
  if (i > 0) {
    final PlayerInfo pinf = PlayerInfoFactory.getPlayerInfoWithWurmId(helper.getPlayerId());
    if (pinf != null) {
      buf.append("text{text=\"" + pinf.getName() + ": " + i + " (" + i * 100 / this.maxHelps + "%) \"}");
    }
    else {
      buf.append("text{text=\"Unknown: " + i + " (" + i * 100 / this.maxHelps + "%) \"}");
    }
  }
}

The only changes required are the if (i > 0) statement and multiplying i by 100 when generating the string.

  • Like 2

Share this post


Link to post
Share on other sites

Much appreciated, saved me some time hunting this down.

  • Like 2

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this