• Announcements

    • Keenan

      Server Crossing Issues   03/23/17

      There are issues with server crossing. Please refrain from crossing borders if possible until the issue can be resolved. Thank you!
Sign in to follow this  
Followers 0
thorgot

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

2 posts in this topic

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.

Share this post


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