the thing is, when getting the mouse position using this function in the on_put_item event, the calculated position is not always the mouse position, quick way to see that :
make a mod with the on_put_item event, with in it a code that moves the cursor to the position calculated using the function
small sample of code :
Code: Select all
function on_put_item(event)
local player = game.players[event.player_index]
player.cursor_position = player.real2screenposition(event.position)
end
after some tests, it seems to be linked to the zoom level as the cursor gets moved only when not at zoom level 1.000