The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.
This leads to the trees seeding underground, too, unfortunately.
The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.
This leads to the trees seeding underground, too, unfortunately.
Added a callback QueryRebuy(int for_player, object base) in the vendor library. If an object that will be sold returns true in that function then the object will not be added to the base material of the selling player.
Currently the only objects that are sellable are Diamond, GoldBar, Nugget, Ruby. They cannot be rebought, just as in the previous implementation.
The existing Seed() places plants with a random chance. This makes testing the placement tiresome, so the actual placing part was moved to the new function DoSeed().
This revealed a bug: Transferring single arrows to the surrounding with the "transfer all button" leaves single arrows in the environment, instead of actual stacks.
Transferring them with single clicks stacks the arrows though.
The trick was that the Clonk does not exit the object right away, but gets a drop command instead. Furthermore, it was confusing that the Collection2-callback never actually happens in this situation.
The original implementation is ok, but why check the value if it would not change anyway? In the new implementation the variable lives only where it can actually change, and so does the if-clause.
Transfer of items from one container to another is handled differently between the following actions: a) select items for transfer in the inventory box; b) transfer all items with the transfer-all-arrows.
This should be made consistent, especially since action a) seems to have an unnecessary special case (marked with TODO).
As a first step the methods were simply extracted.