Fixed searchPtr performance problems

Changed priorities in World::searchPtr to improve script performance (tested in cell 2,-6).
Could be accelerated further by moving the if (!activeOnly) block at the very top, but afaik references in active cells are supposed to have priority. Is that correct?