vgstation-coders / vgstation13

Butts
GNU General Public License v3.0
264 stars 543 forks source link

Chickens, cows, etc. can swap places with other mobs through a one-direction window/regardless of intent #2742

Closed ghost closed 9 years ago

ghost commented 9 years ago

The window has to be placed on the chicken's tile, placing it outside won't work. This also happens even if your intent is set to harm/push/grab. I assume this happens with every simple_animal, but god knows what else could be affected.

WebM that illustrates this: http://a.pomf.se/yclmqq.webm

IratePirate commented 9 years ago

Is this what leads to monkeys breaking out of their pen all the time?

ghost commented 9 years ago

Yeah, there's some issues with diagonal windows too, especially when the room depressurizes quickly in that direction--some items fly off the room through them.

d3athrow commented 9 years ago

Diagonal movement should have been fixed from the TG stuff I merged.

d3athrow commented 9 years ago

Spent the better part of a day trying to figure out why its happening. Simple animals, excluding Ian, are bumping into things even after turf/Enter returns false, except their second bump seems to be byond's default turf/Enter check which shouldn't ever be ran as a result it is ignoring the window as its on the chicken's tile and simple animal's bump action for mobs are to swap places with them.

d3athrow commented 9 years ago

Turns out that Move() calls Bump on the first dense thing it finds in the target location if turf/Enter or atom/Cross returns false. This resulted in us bumping the window when we found it in our way resulting in no move, then Move caused us to bump the human on the other side of the window. Simple animal code causes it to switch places with any mob it bumps into.