saltyhotdog / BattletechIssueTracker

Public issue tracker to communicate with modders and HBS.
MIT License
6 stars 0 forks source link

Does not load all defs for save game for first MechLab visit #10

Closed CptMoore closed 6 years ago

CptMoore commented 6 years ago

Describe the problem

Game Version 1.04

When: After loading a campaign save game (not in combat). What: If a component is not used in a mechdef, but does exists in the inventory, and you enter the mechlab, that component def is not listed. Workaround: Exit the mechlab and enter it again for the item to appear in the mechlab inventory.

E.g. happens with heat banks and heat exchangers.

Edit: only heat sinks defs are affected

Provide an example of the code where the problem occurs

SimGameState GetAllInventoryItemDefs

this.DataManager.Exists(battleTechResourceType, array[2])

Returns false because the component defs was not loaded before entering the MechLab.

If the component def is mounted to a mech, then through transitive def loading the issue wont appear, so its only for yet not mounted component defs that this happens.

Provide an example of your proposed solution

Somewhere before entering the mechlab, load all defs for every item in the SimGameState inventory.

in SimGameState.RequestDataManagerResources() add a line like this

this.DataManager.RequestAllResourcesOfType(BattleTechResourceType.HeatSinkDef, true);

Provide a link to a commit in the private repo for this issue

Leave any additional comments here

saltyhotdog commented 6 years ago

Does this happen with unmodded heatbanks and exchangers? If so we'll upgrade it to Sev 2 and mark it HBS Ready.

CptMoore commented 6 years ago

This is happening for an unmodded game

caardappel-hbs commented 6 years ago

An internal ticket has been created to reassess item loading in the MechBay.

Morphyum commented 6 years ago

Closeing for now since HBS has created a ticket for themselves.