When applying an image to a /turf via MouseEntered() or MouseExited(), it lags behind by a tile. The location is set to the correct /turf, but the image is drawn on the tile I had moved my mouse over from.
Numbered Steps to Reproduce Problem:
see Code Snippet
Code Snippet (if applicable) to Reproduce Problem:
mob/player
var/tmp/image/move_indicator
turf/MouseEntered(location,control,params)
if(istype(usr, /mob/player))
var/mob/player/p = usr
if(!p.move_indicator)
p.move_indicator = image('indicator.dmi',src,"Red",FLY_LAYER,null)
p << p.move_indicator
else
world << "[src.x] [src.y]" //outputs the turf's x/y
p.move_indicator.loc = src //set to turf I entered before this /turf
world << "[p.move_indicator.x] [p.move_indicator.y]" //outputs the turf's x/y, they match
Expected Results:
Image to be drawn on the correct turf.
Actual Results:
Image is drawn on the turf I moved my mouse from.
Does the problem occur:
Every time? Or how often? yes
In other games? dont know
In other user accounts? dont know
On other computers? dont know
When does the problem NOT occur?
When I revert to 510.1339
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
510.1339 was the last version this worked. From 510.1340 and up, it stopped functioning properly.
Workarounds:
Revert to 510.1339
I tried your code in a test project and didn't see the problem. I thought maybe the fact that there are screen objects being animated might be relevant, so I tried on a more vanilla project. Same thing: The image was always on the correct square in 510.1344.