ID:154766
 
I'm creating a roguelike that uses Bump() for combat, and I've ran into a strange issue.

Mobs larger than world.icon_size get bumped twice, instead of once. Mobs that are equal to world.icon_size only get bumped once. It doesn't seem to matter how big the mobs are, just as long as they're larger than world.icon_size then Bump() is called twice instead of once. I suspect this may be a bug but I figured I'd ask here first.

I threw together a quick demo to show off the problem in 493.1117, it can be downloaded here.
Bump. Anyone have a clue as to why this would be happening?
... Weird issue o.o... Never saw something like it... I think the one who figures out how to solve it is a genius, haha xD
I only see it happening when the mob you're bumping into has its step_x and step_y vars set to zero and you're bumping into its bottom-left 32x32 area. It's probably some weird thing where its treating the collision as tile-based and pixel-based.

You can define your own proc and find ways to limit how often it gets called. For example:

mob
var
list/bumped

Move()
if(bumped)
bumped.Cut()
else
bumped = list()

return ..()

Bump(atom/a)
if(a in bumped) return

bumped += a
MyBump(a)

proc
MyBump(atom/a)
src << "You bumped [a]."
In response to Forum_account
I kinda think it will work, but does it show the message if you bump it for a second time? I mean you bump it 1 time, you get 1 message, but if you bump it a second time, will you get a message? I think there should be added something like

//It's in the list now, since you bumped it and like
sleep(1)
del //idk, the thing in the list, so you can bump it again, but you will get the message only once when you bump it once...
In response to Forum_account
Ah, that fixes it. Thank you.

Do you think this is a bug with BYOND though? The project in question I'm working on does not use pixel movement at all, instead using rigid tile-based movement (with animate_movement set to NO_STEPS and such).
In response to LordAndrew
LordAndrew wrote:
Ah, that fixes it. Thank you.

Do you think this is a bug with BYOND though? The project in question I'm working on does not use pixel movement at all, instead using rigid tile-based movement (with animate_movement set to NO_STEPS and such).

I'd consider it a bug but I wouldn't be surprised if it turned out to be a misunderstood feature.