Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
13 stars 5 forks source link

Container sprite fix #212

Closed snipercup closed 4 months ago

snipercup commented 5 months ago

Fixes #189

No sprite was saved and loaded for containers, so I added that functionality. This only applies to containers created during gameplay, for example when moveable furniture or a mob is destroyed and loot is created. In order to do this, I had to pass more then the position into construct_self, so now construct_self takes a dictionary of the item that was first saved and then loaded.

Then there were some issues with setting the sprite after a load. It checked if the container was added to the scene tree. But when the container was loaded, the chunk would add it to the levelmanager instead of the scene root. I changed it so that chunk adds containers to the scene root now.