Why not only npc->viewdb,(same comment applies to line npc->viewdb2)