Bug Maximizer fails to fold umbrella when equipping to Left-hand man in WotSF

Montypythn

New member
Mafia Version: r27869

I encountered this running autoscend in Way of the Surprising Fist, but was able to write a minimal test to reproduce the error without much effort. The actual command produced by the maximizer on the boost is "umbrella ; equip familiar ¶10899". This command, when run, causes the umbrella command to return an error and print out "What state do you want to fold your umbrella to?", which and causes autoscend to halt.

The test below passes is you remove the word "broken", which matches exactly what I experienced and was able to reproduce in run. I dug around a little in the maximizer code, but couldn't figure out where the issue might be. Maybe it has something to do with how the best mode is determined by comparing it to other offhand options.

Java:
    @Test
    public void suggestEquippingUmbrellaOnLeftHandManInWotSF() {
      final var cleanups =
          new Cleanups(
              withEquippableItem("unbreakable umbrella"),
              withFamiliar(FamiliarPool.LEFT_HAND),
              withProperty("umbrellaState", "cocoon"),
              withPath(Path.SURPRISING_FIST));

      try (cleanups) {
        assertTrue(maximize("exp"));
        assertThat(
            someBoostIs(b -> commandStartsWith(b, "umbrella broken; equip familiar ¶10899")),
            equalTo(true));
      }
    }
 
Top