VERY IMPORTANT: An interesting fact about respawning inventories is discovered. The tutorial in ToEEWB says that you MUST specify the following flag for the substitute inventory container: OF_DYNAMIC In fact, this flag makes the game CRASH at inventory respawn when used with containers whose inventory must be respawnable. Therefore, OF_DYNAMIC MUST NOT BE SET in case you create a NPC with respawnable inventory! If the inventory shouldn't be respawnable, OF_DYNAMIC must be set. Please keep this in mind while developing NPCs with respawnable inventory! There are also other flags which are usually not set for NPCs with respawnable inventory: OF_NO_BLOCK, OF_INVISIBLE. I'm not sure if they have any effect on the container validity, but I doubt it. Thanks for reading. - Agetian
This, of course, was discovered when Agetian kindly tracked down the problem with Ah Fong - thanks Agetian!! :notworthy