An object that is placed on the map with a pixel offset of 128 or more will keep that offset if added to the client screen, even after setting pixel offets to 0.
This is a difficult report to make, it may make more sense to explain it in context.
1) A card object is placed on the map with a pixel_x offset of 200.
2) Card needs to return to the players hand, which is represented on the hud, it must be removed from the map and added to the client screen.
3) Card screen_loc is set to "1:0,1:0" and pixel_x is set to 0.
4) The displayed card will not appear at 1:0,1:0, instead shows up 200 pixels to the right. Regardless of pixel_x being 0.
Code Snippet (if applicable) to Reproduce Problem:
world
name = "test"
map_format = TOPDOWN_MAP
view = 17
New()
..()
test_obj = new
test_obj.screen_loc = "1:0,1:0"
mob
icon = 'icon.dmi'
icon_state = "pc"
turf
icon = 'icon.dmi'
icon_state = "grass"
obj
icon = 'icon.dmi'
icon_state = "object"
layer = 100
var/obj/test_obj
mob/verb
// Put object on the map first
first_verb()
test_obj.loc = locate(1,1,1)
test_obj.pixel_x = 128 // Any value under 128 will display the object correctly
// Removes from map and position on the HUD
second_verb()
test_obj.pixel_x = 0
test_obj.loc = null
client.screen += test_obj
Expected Results:
Prior to v489.1099 the object appeared correctly positioned using screen_loc and pixel coordinates.
Actual Results:
Setting an object's pixel coordinate greater than 127 will incorrectly display it on the hud.
Last version:
Above code works correctly in 488.1098