ID:273510
 
I know that Bump() is called when an object hits another dense one and it is called by whichever is moving on the stationary object.

My question is this: What if both objects are moving and try to enter the turf at the same time?

Assume that all the necessary condition are in place for them to arrive at the exact same time in the same space. Which bump() is called, or are they both called?

My question stems from the fighter I'm working on. Since hit boxes are dense, if they are hit by a player (IE jumped/fallen on rather than hit directly) then the player sits there and waits until the box disappears a fraction of a second later. Fixing that is a simple solution, but I'm wondering if say a player is running and their opponent uses an attack just before they get there. The hitbox is created and sent at the same time the player enters the space. It's happened before but before i put a fix to the above in place, so the hitbox only activated once. But if the player colliding with it and the box colliding with the player both do the same thing and are both called then the action will occur twice.
You will never have two objects entering the same tile at the exact same time as you describe. It will always happen one after the other. Whichever happens first, its motion will be calculated as if the other object is still in its original position (since it is in its original position). Whichever one happens second will then bump the first one that is already there, assuming they are both dense.

(edit)
Let me add something to clarify. Even if both objects will enter a tile during the same tick, one will STILL happen before the other.
proc/tester()
var/mob
M1 = new(locate(1,1,1))
M2 = new(locate(3,1,1))
spawn(1)
step(M1, EAST)
spawn(1)
step(M2, WEST)

One of them will step into the turf at location (2,1,1) before the other. Whichever one does, that one will not be interfered with under normal circumstances (normal circumstances meaning "unless you've changed the default behavior yourself"). The other one will then bump into whichever one moved first.

One will always happen before the other. Nothing at all ever happens at exactly the same time, nothing, movement or otherwise.
Pyro_dragons wrote:
My question is this: What if both objects are moving and try to enter the turf at the same time?

That can't happen, because only one action will ever happen at once. One of the objects will always move first.

Lummox JR
In response to Lummox JR
Alright, that answers my question. Thanks guys, that'll help a lot.