View Single Post
Old July 21, 2016, 08:51   #8
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Funny stuff... consider ui-target.c. Why does pathfinder work (press 't', navigate to a square, press 'g' and go there) when targeter does:
    case 'g':
        cmd_set_arg_point(cmdq_peek(), "point", y, x);
How does that work when cmd_set_arg_point() takes x, y? Because do_cmd_pathfind() does:
    /* XXX-AS Add better arg checking */
    cmd_get_arg_point(cmd, "point", &x, &y);
    if (findpath(x, y)) {
and, of course, findpath()...
bool findpath(int y, int x)
I guess I'll have to leave the y, x stuff as it is, "fixing" it will just wreck the game at this point
t4nk is offline   Reply With Quote