Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Wrong code in BaseLogisticsHullMod?  (Read 394 times)

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Wrong code in BaseLogisticsHullMod?
« on: August 23, 2020, 06:43:50 AM »

Code: java
	@Override
public String getUnapplicableReason(ShipAPI ship) {
boolean has = spec != null && ship.getVariant().hasHullMod(spec.getId());
int num = getNumLogisticsMods(ship);
if (has) num--;
int max = getMax(ship);
if (num >= max) {
String text = "many";
if (max == 1) text = "one";
else if (max == 2) text = "two";
else if (max == 3) text = "three";
else if (max == 4) text = "four";
text = "" + MAX_MODS;
return "Maximum of " + text + " non-built-in \"Logistics\" hullmods per hull";
}
return super.getUnapplicableReason(ship);
}

So why text is always MAX_MODS.
I modify the max number, and the tool tip always give me  "Maximum of 2 Logistics hullmods per hull"
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Wrong code in BaseLogisticsHullMod?
« Reply #1 on: August 23, 2020, 09:37:43 AM »

You're right, thank you!

Checking just now, looks like I already fixed this in the dev build, so, this is good to go for the next release.
Logged