Bug - Fixed Plumber skills incorrectly have traincost

philmasterplus

Active member
Due to a faulty if-statement in SkillDatabase.java, Path of the Plumber skills had traincost values assigned to them just like regular guild skills (125, 250, ..., 15000). Here's a patch that prevents all non-guild skills from entering the relevant switch statement.

This patch was lightly tested on r20535 by pasting the following line in the gCLI:

Code:
js Skill.all().filter(s => s.traincost !== 0).forEach((s, i) => print(i + ": " + s.name + " (" + s.class + ", " + s.traincost + ")"));

Before the patch, it listed 194 skills (180 guild skills + 14 plumber skills). After the patch, it listed only the 180 guild skills.

I also purchased a skill in the relay browser to execute GuildRequest.parseResponse(), which appears to exercise this particular code path. I don't know how to hook up the debugger in IntelliJ, though, so I couldn't check if the code path was actually executed. The meat cost in mafia's panel was correctly reduced, though.
 

Attachments

  • kolmafia-philmasterplus-plumber-skill-no-traincost.patch
    628 bytes · Views: 1

MCroft

Developer
Staff member
Well, I get Returned: org.mozilla.javascript.Undefined@0 after running your example, but that's @ikzann's code that we mentioned elsewhere.

And I used the debugger and it definitely hit that line and worked as expected.

r20538
 
Top