Fixes wandering turrets.

Fixes #9466

I'm blaming C++11 which slightly changes the meaning of the % operator (it's more or less implementation specific in C++03, but exactly specified in C++11). Also it only happened when the character walks from the south or the east towards where the monster was.