Fixed segfault (the NPCs tried to go out of the map since last commit)