ID:117939
 
Resolved
Objects with pixel offsets outside of the -127 to +127 range could incorrectly show the pixel offset when added to client.screen instead of using the offsets from screen_loc.
BYOND Version:489
Operating System:Windows XP Pro
Web Browser:Firefox 6.0.1
Applies to:Dream Seeker
Status: Resolved (490)

This issue has been resolved.
Descriptive Problem Summary:
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
Just to clarify, you mean you see a pixel offset on a HUD object if its pixel_x/y is greater than 127?
pixel_x/y/z don't apply at all to HUD objects; the pixel offsets are built into screen_loc.
This issue was fixed immediately after reporting it back in September.

But to clarify, yes the pixel offsets above 127 were visible when adding an object to the HUD (even after setting the pixel offsets to 0).

While the object was on the map, I used pixel offsets. When moving it to the HUD, I reset the pixel offsets to 0 and used screen_loc. Hope that helps.
Actually I was asking Ocean King for clarification, who has annoyingly deleted his comments.