Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old May 24, 2009, 01:55   #41
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
Hooray!! I added a define for in_town_fully, and changed this
Code:
			/* Ignore illegal locations */
			if (!in_bounds_fully(y, x)) continue;
to this
Code:
			/* Ignore illegal locations */
			if ((p_ptr->depth) && (!in_bounds_fully(y, x))) continue;
			else if (!in_town_fully(y, x)) continue;
and I can't get it to crash again. I hope that means that the crash bug is fixed. I still wonder why it crashed for me but not for Paul. DaJAngband 1.0.98 should be released very soon (..unless I was wrong about this one being fixed or I find another serious bug that I can't figure out).

Thanks for the help!
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old May 24, 2009, 01:59   #42
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Which brings us to the question: why are there two macros where one will serve?

#define in_bounds_fully(y,x) \
(p_ptr->depth == 0 ? .... )
Pete Mack is offline   Reply With Quote
Old May 24, 2009, 02:11   #43
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
Which brings us to the question: why are there two macros where one will serve?

#define in_bounds_fully(y,x) \
(p_ptr->depth == 0 ? .... )
I don't know how to finish that sentance. The only reason I could make a 'in_town_fully' is because there was already a similar 'in_bounds_fully' to copy from and replace DUNGEON with TOWN.
I do a lot of things that way actually. I wouldn't know how to do it from scratch without help, so I just copy it from something similar and tweak it.
The monster roaming code choses a random destination for the monster to go towards using stuff copied from the teleportaiton code.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old May 24, 2009, 02:18   #44
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
#define in_bounds_fully(Y,X) \
( (Y) > 0) && (X) > 0) && ( p_ptr->depth != 0 ? \
((Y) < DUNGEON_HGT-1) && ((X) < DUNGEON_WID-1) \
: ((Y) < TOWN_HGT-1) && ((X) < TOWN_WID -1) ) )


EDIT: Cut and paste errors fixed

Last edited by Pete Mack; May 24, 2009 at 02:40.
Pete Mack is offline   Reply With Quote
Old May 24, 2009, 02:32   #45
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
I did that and it gives me an error saying "missing ";" before '&&'" and points to the lines where in_bounds_fully is referenced.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old May 24, 2009, 02:40   #46
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
It's fixed, I think. I left a few scattered ')' characters around.
Pete Mack is offline   Reply With Quote
Old May 24, 2009, 02:51   #47
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
You need two more open parenthesis at the beginning. (I don't really know how to write original code, but I know how to count parenthesis..).
Now your 'in_bounds_fully' works.
Thanks
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old May 24, 2009, 03:15   #48
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,862
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by will_asher View Post
I do a lot of things that way actually. I wouldn't know how to do it from scratch without help, so I just copy it from something similar and tweak it.
This is a very good way to learn, rather than trying to do everything from scratch and then giving up.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old May 24, 2009, 08:05   #49
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
Which brings us to the question: why are there two macros where one will serve?
Because it's easier to follow.

Sometimes I think it's more important that code is easy to understand than efficient. Of course "easy to understand" depends heavily on the person looking at it.
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old May 24, 2009, 09:17   #50
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
I've quickly gotten to like this Visual C++ debugger a lot. When it finds a bug, it actually lets you know whats wrong, unlike my old compiler.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher 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
[FA] Crash Bug Zikke Variants 8 February 19, 2009 05:20
r1264 bug: crash at prompt (Windows) Colbey Vanilla 11 February 13, 2009 17:39
Entro crash Zikke Variants 2 February 2, 2009 21:08
Elemental attacks destroying inventory items - challenging or frustrating? hugorune Vanilla 24 January 28, 2009 09:23
YASD - the most frustrating death in the world Big Al AAR 13 February 2, 2008 19:31


All times are GMT +1. The time now is 04:52.


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