Jump to content

AddBuildingToPlanScreen with BuildingOrdering.Before uses wrong index


SGT_Imalas
  • Branch: Live Branch Version: Windows Fixed

when using ModUtil.AddBuildingToPlanScreen with BuildingOrdering.Before, the insertion index is wrong.

the marked code needs to be Mathf.Max(num2,0), otherwise the inserted building is put into the list with an offset of 1 from the position, yielding the result:

[building_id-building], [some other building in the menu], [relativeBuildingId-building]

image.png.813ac750e6b27658ec5e5a3326d7202d.png


Steps to Reproduce

use ModUtil.AddBuildingToPlanScreen to add a new building to the planscreen using BuildingOrdering.Before

notice that the building position in the planscreen is inserted one building too early / it has one building between itself and the relativeBuildingId building




User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...