Giter Site home page Giter Site logo

3.25 : NPE when advancing a day about mekhq HOT 12 CLOSED

megamek avatar megamek commented on September 4, 2024
3.25 : NPE when advancing a day

from mekhq.

Comments (12)

Akjosch avatar Akjosch commented on September 4, 2024

You assigned Cpt. Travis Riviera (who has like no tech skills, at all) to work on repairing an AMS.

I'm not sure if that assignment should be made totally impossible (yes, it will always fail, but you could still gain XP from it I guess, while burning through equipment), but the code certainly needs a guard there, just in case.

from mekhq.

arlith avatar arlith commented on September 4, 2024

I don't think the UI is supposed to allow people without the proper skill to be assigned to a repair job. There's potentially a bug in how this assignment was allowed. (I'm not super familiar with MHQ code, so I may be wrong).

from mekhq.

Dylan-M avatar Dylan-M commented on September 4, 2024

@arlith No, you are correct. An assignment should not be allowed unless the person has the proper tech skills.

from mekhq.

Question2 avatar Question2 commented on September 4, 2024

Hmm, in the warehouse, i was simply clicking the "do task" button without checking which tech was going to be assigned (since i pretty much have all elite techs anyway). I guess at some point Cpt Travis Riviera (a vessel gunner) got selected. Not sure why he would show in the list of techs for the warehouse though, if hes a vessel gunner.

from mekhq.

arlith avatar arlith commented on September 4, 2024

I think that, for large craft, the crew performs repairs/maintenance. That may be how this came about, I dunno if the code around repairing/maintaining large craft is fully implemented.

from mekhq.

Dylan-M avatar Dylan-M commented on September 4, 2024

Not quite, there is an "Engineer" for vessels.

from mekhq.

Akjosch avatar Akjosch commented on September 4, 2024

Manually removing the repair job from the cpnx file allows the day to advance normally and without any errors in log.

This doesn't fix the issue; it just lets Question2 play the game.

battletech.zip

from mekhq.

Question2 avatar Question2 commented on September 4, 2024

Thanks for the help!

from mekhq.

Akjosch avatar Akjosch commented on September 4, 2024

So ... try as I might, I still didn't manage to replicate the behaviour. Anybody has any more luck?

At best, we can add some extra checks to make sure nobody with no tech skills gets assigned and that a day gets passed (with an automatic failure) if a broken save game includes such.

from mekhq.

Dylan-M avatar Dylan-M commented on September 4, 2024

If we add such extra checks, I'd rather that on campaign loading that person got un-assigned from the repair. Or if it's difficult on loading, then on the advance day checks for repairs.

As for how this can happen? It's easy: Have a tech skill on someone, assign them to a repair, and then remove the tech skill from them. Whups!

from mekhq.

Akjosch avatar Akjosch commented on September 4, 2024

Well, a fix-at-load-time check won't help us with people messing up their game state by abusing the GM tools ...

from mekhq.

Akjosch avatar Akjosch commented on September 4, 2024

Added an NPE guard in newDay() and a report line stating that the non-tech was removed from repairing the part.

from mekhq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.