Code cleanup

This commit also assures that Npc::closeAllShopWindows won't get stuck
in an infinite loop.