Khaligufzel / Dimensionfall

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

Fill up Containers in thread #255

Closed snipercup closed 2 months ago

snipercup commented 2 months ago

Requires #254

The containers were filled up on the main thread. This will happen when:

This isn't a problem if there's only a few furniture, but it adds up when the clothing store spawns. I moved as much as possible to the _init function, which has now replaced the construct_self function. Now most of it happens in a thread and not on the main thread. This increases the performance of the game.

As a side effect the furniture containers will now have their sprite set to one of the items inside the container. When you take an item out, it will change to the container_full sprite. I decided to leave it like that since you can now tell which container you've inspected closely by taking an item out.