Hi,
I can pick items from the world to players inventory, I can also drop those items back into the world and am able to pick them up and drop them down multiple times. The problem occurs when I save and later load the game, the players inventory items are loaded successfully (or so it appears), I can drop them back into the world, the physics still work, but I'm unable to pick these items back up?
Hopefully relevant info:
in my player class derived from Game::Chr, I have:
Code:
Memx<Game::Item> inventory;
virtual Memx<Game::Obj>* itemContainer() {Memx<Game::Obj> &ic=inventory; return ⁣}
I overloaded the base method itemContainer() to auto-include inventory in the save game, as commented in the headers
also:
PHP Code:
//global containers
Game::ObjMemx<Game::Item > Items;
// world types setup
void InitGame()
{
...
Game::World.setObjType(Items , OBJ_ITEM );
...
}
..and in UpdateGame() i use itemPickUp() and itemDropDown() base methods.
I also tried manually saving the inventory and not overriding itemContainer() method, either way the results are the same, the items get saved and loaded, they can be dropped via itemDropDown(), but I can't retrieve them from the world afterwards.. any ideas what i'm missing?