View Single Post
Old July 21, 2016, 08:51   #8
t4nk
Swordsman
 
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:
Code:
    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:
Code:
    /* XXX-AS Add better arg checking */
    cmd_get_arg_point(cmd, "point", &x, &y);
    ...
    if (findpath(x, y)) {
    ....
and, of course, findpath()...
Code:
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