ID:122362
 
Resolved
Objects straddling multiple tiles could be bumped more than once in the same Move() call.
BYOND Version:493
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 16.0.912.63
Applies to:Dream Daemon
Status: Resolved (494)

This issue has been resolved.
Descriptive Problem Summary:
When using tile-based movement and Bump(), bumping something that appears to be set larger than world.icon_size will be bumped twice. See also this post.

Numbered Steps to Reproduce Problem:
Download demo

  1. Run the game.
  2. Bump into the single tile enemies. Bump() is called once.
  3. Bump into the large enemies. Bump() is called twice.


Code Snippet (if applicable) to Reproduce Problem:
n/a, demo provided.

Expected Results:
Bump() is only called once on the large mobs.

Actual Results:
Bump() is called twice.

Does the problem occur:
Every time? Or how often? Every time.
In other games? Untested.
In other user accounts? Untested.
On other computers? Untested.

When does the problem NOT occur?
Never.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Untested, though I suspect it's from the more recent versions due to bounding boxes being involved.

Workarounds:
Forum_account provided a workaround here.
If you are using pixel movement, or using bounds larger than a single tile, then objects can enter/cross/bump multiple tiles when they move.
Lummox JR resolved issue with message:
Objects straddling multiple tiles could be bumped more than once in the same Move() call.
In response to Falacy
Falacy wrote:
If you are using pixel movement, or using bounds larger than a single tile, then objects can enter/cross/bump multiple tiles when they move.

Confirmed. I don't know if this was supposed to be included in the fix or if it has its own bug report somewhere, but Cross and Crossed are in the same boat as Bump. They are called multiple times. I made an object with a bound width of 96 and a bound height of 32 (basically three 32x32 tiles) and it calls said procs three times and completely ruins the code.

Edit: Sometimes they're called six times (or double the amount of tiles). Two bugs, maybe?

Crossed is also called every time you enter a new tile while you're in the bounds of a large object (128x128 for example).
Cross() being called multiple times is actually expected (it's difficult to work around) but I'm not sure that's meant to be true of Crossed(). But that'd belong in a separate report--the double bump has been fixed.

[edit]
I don't see multiple Crossed() calls going on in a test where I'm already inside the bounds of a large obj spanning multiple tiles.
In response to Lummox JR
Lummox JR wrote:
Cross() being called multiple times is actually expected (it's difficult to work around) but I'm not sure that's meant to be true of Crossed(). But that'd belong in a separate report--the double bump has been fixed.

[edit]
I don't see multiple Crossed() calls going on in a test where I'm already inside the bounds of a large obj spanning multiple tiles.

I started a new project and Crossed isn't being called multiple times like I said, only Cross. But for some reason in an older project, Crossed is being called multiple times, so something else must be going on, most likely older code not wanting to work with this stuff. So I'm sure I can fix that on my own.

Cross is called multiple times (both on first Cross and while entering new tiles inside the bounds), though, which is annoying, but you mentioned it's hard to work around, so, I guess that's that.