Reply To: Broken Loot Chests

Home Forums MeseCraft Discussion Support Broken Loot Chests Reply To: Broken Loot Chests

#3928
gd2shoe
Participant

    Breakthrough.  I have a partial fix.  It’s ugly as sin.  It needs to be formatted and subjected to code review.

    Fundamentally, I’m using __index and __newindex to intercept all access to the data table except when the vm is directly involved.  (I’m letting it have the raw, underlying table for performance and for predictable behavior.)  Any node getting set that has a constructor gets thrown into a queue.  Constructors are called after the changes are committed to the map.  This should broadly fix all constructor issues, should any other nodes require it.

    The problem that remains: The chests are no longer buggy… but they are still empty.  I’m guessing that there’s some sort of lootchest mod registration that needs to take place?  Maybe this is an area that just hasn’t been worked on at all?

    Apparently the door thing is a different, unrelated issue.  plans.lua uses ‘doors:door_steel_a’ all the time, when half the time it should be using ‘doors:door_steel_b’.  Fixing that is going to be… bothersome.  It should be fixed, but I’m not sure how without accidentally getting ‘a’ and ‘b’ mixed up half the time.  (How did this happen in the first place?)