ID:2433385
 
Resolved
Visual contents were not being cleared in some cases such as extreme changes to client pixel offsets.
BYOND Version:512
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Firefox 56.0
Applies to:Dream Daemon
Status: Resolved (512.1465)

This issue has been resolved.
Descriptive Problem Summary:
Mob step_x/y and client pixel_x/y alternating between > abs(32) and <= abs(32) causes nearby vis_contents to update improperly


Numbered Steps to Reproduce Problem:
1.Download test project
2.When running clicking on a turf will cause the screen to alternate between client.pixel_x 33 and 0 while a trail of !s will follow your mouse
3.Wave mouse around for a bit
4.Click again, this will cause the shake and !s to stop
5.Testing has shown there are generally !s left on the screen, however none of them are actually in the vis_contents where they seem to be

(optional) 6. uncomment the del(ping) in the code for even more !!FUN!! as the invalid vis displays start to jump all over the place while !s are created


Code Snippet (if applicable) to Reproduce Problem:
https://www.dropbox.com/s/muga73896fqn5cc/ vis_contents_issues_offset.zip?dl=1

Expected Results:
Things removed from vis_contents should no longer display as if they were in vis_contents

Actual Results:
Objects still seeming as if they were in the vis_contents of other things when they really arent


Does the problem occur:
Every time? Or how often?: Happens quite consistently in the test program
In other games?: Yes
In other user accounts?: Yes
On other computers?: Yes

When does the problem NOT occur?
(in this case) when mob step_x/y and client pixel_x/y < abs(33)

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.)
Did not test on earlier versions

Workarounds:
Cant think of any good ones
I was digging into this in Discoord. Reduced the repro some which might help.
world
view = "30x30"

atom
icon = 'icon.dmi'

client
Click()
usr.bIsShakingScreen = !usr.bIsShakingScreen
usr.ShakeScreen()
..()
mob
var
bIsShakingScreen = 0

proc
ShakeScreen()
spawn()
while(bIsShakingScreen)
// client.pixel_x = rand(1,33) // Not needed.
client.pixel_y = rand(1,33)
sleep(1) // repro's at slow ticks (2,3)

turf
icon_state = "grass"
MouseEntered()
display_ping(src)
..()

obj/vis_ping
icon_state = "ping"

proc
display_ping(var/turf/t)
var/obj/vis_ping/ping = new()
t.vis_contents += ping
sleep(3)
t.vis_contents -= pin
Lummox JR resolved issue with message:
Visual contents were not being cleared in some cases such as extreme changes to client pixel offsets.