Go Back   Angband Forums > Angband > Vanilla

Thread Tools Display Modes
Old July 21, 2016, 16:24   #11
Join Date: Dec 2007
Posts: 299
kandrc is on a distinguished road
It works because there are (apparently) two bugs in the listed code, and they cancel each other out.

Originally Posted by t4nk View Post
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
kandrc is offline   Reply With Quote
Old July 21, 2016, 20:11   #12
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Originally Posted by kandrc View Post
It works because
I thought I already explaned why it works
t4nk is offline   Reply With Quote
Old July 22, 2016, 07:20   #13
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Originally Posted by AnonymousHero View Post
If you're going to do anything about this, might I suggest introducing a "struct point { int x, int y}" instead?
After some thinking I decided to do exactly that. Thank you! Angband actually already has "struct loc". Hopefully that will make the ui a little less bug prone...
t4nk is offline   Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Double height tiles: which type of cursor? PowerWyrm Development 9 July 26, 2012 13:52
Path to target request juggle5 Vanilla 9 May 17, 2011 13:07
minor bug - can shoot but not target PowerDiver Vanilla 7 July 15, 2010 16:59
Target in range indicator? ChodTheWacko Vanilla 1 November 28, 2009 16:14
svn-1452 bug: wielding morning star firestar wants to target d_m Vanilla 6 June 25, 2009 04:11

All times are GMT +1. The time now is 09:45.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.