Hi hello we need to talk about stock BYOND Bump() and how to fix it
Created by: Exxion
If you fail to enter a tile because something on the tile returns 0 on its Cross()
, you Bump()
the first dense object in that tile's contents
. This is not necessarily, and in fact often is not, the thing that actually prevented you from entering the tile.
We handled this before by manually calling Bump()
and making BYOND discard automated calls to it. This was hacky, but worked.
Another way to deal with this is to make objects move themselves to the beginning of their loc
's contents
when they return 0 on Cross()
. I have confirmed that this works, but you need to manually add the object to the beginning of contents
because procs like Swap()
don't work on contents
. I haven't profiled this fix, but it's possible that it could have a performance impact.
So which solution is the best?
- Go back to making automated
Bump()
calls do nothing - Make objects move themselves in
contents
so that the correct object isBump()
ed, which is (marginally) less hacky but also probably a bit slower - Something else, if someone can think of another solution