If `image` instead of `tile` was used, the mod passed nil to minetest.inventorycube.
The color field of a tile is now also supported (the code is used only for the particle image calculation).
This prevents the inventory check on each object in the loop and thus shortens the code.
Additionally, the inventory existence check is removed because get_inventory never returns nil for player objects.
To support lecagy setting names, I added two functions. They use the old setting only if the new one is not set.
(I'm not sure if enable_item_pickup_key is a valid legacy setting…)
I did not test this commit thoroughly.
To support lecagy setting names, I added two functions. They use the old setting only if the new one is not set.
(I'm not sure if enable_item_pickup_key is a valid legacy setting…)
I did not test this commit thoroughly.
There is no field named physical_state, so the item didn't lose the physical property, but it happily hopped towards me after I dropped it.
Disabling physical looked quite wrong, because the item flew through mountains. Instead, it gets zero acceleration now.
To avoid resetting the acceleration in the on_step function, it is overridden to disable acceleration and velocity changes during executing the original on_step.
Small code fix: Add underscores in set_velocity and set_acceleration
There is no field named physical_state, so the item didn't lose the physical property, but it happily hopped towards me after I dropped it.
Disabling physical looked quite wrong, because the item flew through mountains. Instead, it gets zero acceleration now.
To avoid resetting the acceleration in the on_step function, it is overridden to disable acceleration and velocity changes during executing the original on_step.
Small code fix: Add underscores in set_velocity and set_acceleration