RemyR wrote:I can't pinpoint exactly what happened
What happened, exactly, was that a centered size 2 monster tried to move sideways into another monster's square. This is not considered an "easy move" (that is, a move in which each inst in the source tile can just simply move into an open spot in the destination tile) by the code, so it fell through to the special case to handle sideways moves, and centered monsters weren't dealt with. I've fixed that.
RemyR wrote:I think this generalized approach is a bit overkill.
Well, maybe, but this way is actually easier for me to debug, understand, and maintain.
Breaking off into two separate paths of execution is one way of doing it, sure, but then I'd have to duplicate a lot of code: they'd each have their own "easy move" code, their own code to shuffle the other group around on the tile, and such. This way does have a few special cases here and there, but (at least in my opinion) it's not really all that bad. Sure, there are occasional branches of "if it's size 2 remember to check this," but the other way would have a lot of redundant code-- and if it turned out there was a bug, I'd have to fix all that code twice.
As a general principle, I tried to keep this code generic and robust in hopes that it wouldn't break as soon as someone tried to do something weird in a custom dungeon.
Things like "arch.size == oarch.size" are there because I was actually in the middle of experimenting with the possibility of heterogenous monster groups (I make no promises yet!), but I decided to release 0.24 early due to some rather critical bugfixes. It didn't hurt anything, so I just left it there.