probably more tabs here, and generally you need to split lines this long, like:
    if (rl_dist(m->posx(), m->posy(), g->u.posx, g->u.posy) > 1 ||
        !g->sees_u(m->posx(), m->posy(), j)) {
Note the '{', they're mandatory for all conditional and looping statements, even if the body is one line.