Pawel's Mod Corner: Autoharvest, Biome Crops, LostEms & others

Planters are not a problem, I’ve already coded a date palm to test the renewable resource node component.

The problem is I cannot find which part of the code makes it impossible to undeploy objects which have no player_id component and whether it has to be player_1 or just exist in order to work (in which case I’d use a dummy gaia player just like it’s done in Age of Empires series). There’s even a strange lease component using player_id and if it allowed to mark something as temporarily belonging to a player but not counting towards the net worth I’d prefer to use it. There are several ways of approaching the problem: I can modify the undeploy command not to require player_id, I can force it to add player_id when the command is invoked, I can force world generator to add player_id to plants (too invasive for my taste) but I think the most elegant way would be to add the lease component when the command is invoked and make it required in order to undeploy an object.

EDIT: I finally found it in inventory.lua. It is clear that player_id has to be player_1 in order for it to work. As it seems to be a more general issue I’ll continue discussing it here: Undeplyoing items without player ID

EDIT2: I got it working properly without modifying the code too much. This means the release just got way closer, in fact injecting one line into PlaceItemCallHandler does the trick.