Editor: fix npc painted a non existring direction. Fix #510.