Skip to content

[BUG] - Problem with new power chart in the statistics panel #11

@Arflipe

Description

@Arflipe

First of all, thank you for all your work in the DSP modding community!

Now for the issue, buildings added with the CommonAPI do not show up correctly in the power chart in the statistics panel:

Image

The building in the image is the Interstellar Giga Station, but the issue is the call to ItemProto.InitPowerFacilityIndices() seems to happen before ProtoRegistry actually adds the new items, so the ItemProto.powerConIndex2Id (and the similar arrays) do not contain the new items, and the power chart gets the default ItemProto when trying to add the item, producing the result shown above.

I managed to fix this specific issue with a simple

ProtoRegistry.onLoadingFinished += () => { ItemProto.InitPowerFacilityIndices(); };

and it SEEMS this causes no issues, though I'm not entirely sure. Here is the image after adding this code:

Image

Unfortunately I'm quite new to modding and couldn't quite figure out how to even compile the CommonAPI (much less understand what I'm looking at), so I can't solve this and make a pull request, but at least these pointers I can give you (really, if you could help me compile the CommonAPI it would be a great help).

Thanks again for everything!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions