ID:1386433
 
Resolved
Crossed() was called multiple times in some cases.
BYOND Version:500.1210
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 29.0.1547.76
Applies to:Dream Maker
Status: Resolved (500.1211)

This issue has been resolved.
Descriptive Problem Summary:
Under certain circumstances, Crossed() is called a number of times even if it's already been called and you've yet to Uncrossed()

Numbered Steps to Reproduce Problem:
1) Set your step size to [x]
2) Set object step size to [x-number]
3) Allow the user to push the object via Bump()
4) Make an object that only interacts if a player crosses it
5) Push movable object over interactive one.

Code Snippet (if applicable) to Reproduce Problem:
world
fps = 60
maxx = 10
maxy = 10

New()
..()
new/obj/goal (locate(5,3,1))
new/obj/ball (locate(3,3,1))

atom/icon = 'icon.dmi'

turf/icon_state = "grass"

mob
icon_state = "you"
step_size = 4
bound_x = 8
bound_y = 8
bound_width = 16
bound_height = 16

Bump(atom/movable/a)
if(istype(a,/obj/ball/))
step(a,dir)

obj
ball
icon_state = "ball"
density = 1
step_size = 2
bound_x = 8
bound_y = 8
bound_width = 16
bound_height = 16
goal
icon_state = "goal"
bound_x = 8
bound_y = 8
bound_width = 16
bound_height = 16

var
counter = 0

Crossed(atom/movable/a)
if(ismob(a))
counter ++
world << "Crossed! [counter]"

Uncrossed(atom/movable/a)
if(ismob(a))
counter --
world << "Uncrossed! [counter]"


Expected Results:
Crossed to be called once.

Actual Results:
Crossed is called roughly 14 times before Uncrossed is called.

Does the problem occur:
Every time? Or how often? yes
In other games? yes
In other user accounts? yes
On other computers? not sure

When does the problem NOT occur?
When the step size of the pushable object equals that of the player.

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.)
I have no idea.

Workarounds:
Set the step size of the player and object to the same number.
Lummox JR resolved issue with message:
Crossed() was called multiple times in some cases.