So I am working on a simple exploring-engine for a MYST-like experience with pd and I've made a patch that gets control input in the form of one "move forward" bang and two bangs for turning left and right. I've made a map consisting of different "rooms" that one can move in between. The actual room is an abstraction that I feed with a symbol like "garden" or "kitchen" and then I've connected them so that when I press move it should move to the next room in the current heading (N, E, S, W). It all works fine except some times there's a loop somewhere down the line and it moves all the way to the room furthest away in the current heading, instead of just one room. I've also noticed that there's an error "parID :" and then a number, in the pd window every time I move.

I'll just upload the patch and the abstraction and maybe someone could explain what I'm doing wrong?

http://www.pdpatchrepo.info/hurleur/mystproject.zip