Manhack deactivation

I’m currently working on a Pokemon mod for cataclysm(because we definitely need it), and I am having a difficult time finding what enables friendly manhacks to be deactivated and picked up.

Can someone tell me which source files those functions are in?

game.cpp, disable_robot

Thanks, that is helpful.

Wow, game.cpp is so long…

I’ve managed that, in the same manner as the turrets.

Okay, how do I instantiate an item from the id and place it somewhere?
edit: Figured it out, was also in that function.

Note that it’s currently not really possible to store an entire monster type inside an item. It wouldn’t be particularly hard to make it possible, though.

Just adding an unique_ptr in the item type and handling it on save/load in a similar way item contents are handled would probably be enough.

I kindof liked the manhack method, as it’s really funny when you throw out a pichu and the game says "The pichu scans you and emits an IFF beep"
Though, I suspect that this is a stupid stopgap that ruins the whole point of having pokemon in it.
I’ll look into actually changing the item so that this can happen without being stupid.

edit: It appears that there isn’t a forward definition of monster in the item class, so it can’t have the unique_ptr type for that.
Adding that in, it seems to cause everything, and I do mean everything to break, mostly the things that need the default constructor for the Item class, the copy constructor, the destructor, etc… I don’t want to rewrite any of that, so I need a bit more help with that. I think I might be able to just use a monster pointer normally, as it is checked considerably less…

Anyway, thanks for helping me around the code.

Edit again:

I’m having trouble figuring out how to serialize the monster internally. I’ve settled on storing the id, and its experience for now.