sirskunkalot / PlanBuild

Valheim mod enabling you to plan buildings, copy structures and terraform
Do What The F*ck You Want To Public License
8 stars 13 forks source link

Handle piece removal at runtime #85

Closed searica closed 5 months ago

searica commented 7 months ago

Looks like the issue had to do with how there are Vanilla prefabs that have a piece component that are enabled by default so even though I have removed them from the Vanilla hammer (after I added them) PlanBuild still knows they exist and that they are enabled, so it was added them back to the PlanHammer piece table.

To solve this I added a HashSet that is used to track which pieces are in a PieceTable when the ScanPieceTables method is triggered and when going through all the plan pieces it now checks if that HashSet contains the name of the original piece before adding it to the PlanHammer piece table.

sirskunkalot commented 5 months ago

Thanks searica. Better late than never I guess ;)