Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old July 21, 2016, 17:24   #11
kandrc
Swordsman
 
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.

Quote:
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:
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
kandrc is offline   Reply With Quote
Old July 21, 2016, 21:11   #12
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
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, 08:20   #13
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
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
Reply


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 14:52
Path to target request juggle5 Vanilla 9 May 17, 2011 14:07
minor bug - can shoot but not target PowerDiver Vanilla 7 July 15, 2010 17:59
Target in range indicator? ChodTheWacko Vanilla 1 November 28, 2009 17:14
svn-1452 bug: wielding morning star firestar wants to target d_m Vanilla 6 June 25, 2009 05:11


All times are GMT +1. The time now is 07:43.


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