Saturday 30 July 2011

Shops

After returning to Kaduria I was fixing some stuff and noticed there was no support for shops in rooms so I started to refactor that. The source code was there already, I just had to add a sub type in Room class for shops. Everything seemed to went well, because the shop creation code was also ready. But then... to my surprise it didn't work at all. Everything went wrong: there was only one table in the shop, the shopkeeper was in wrong place and all shop items were null items (this happens when the item creation fails and it's a safe way to detect problems, because null items actually work, they are just not real items).

I guess it should be easy to fix those problems, because the code to create shop and items is really just about 20-30 lines of code.

No comments:

Post a Comment