|
|
#1 |
|
Rookie
Join Date: Jan 2009
Posts: 18
![]() |
(not) running into molds
There was recently a post about modifying the 'run' algorithm to avoid running into immobile monsters like molds. I had a look at the algorithm and one just needs to add the following to run_test() before it goes into the part where it looks for an open area. I've tested it and it seems to work well.
Code:
/* Look at every soon to be newly adjacent square. */
for (i = -max; i <= max; i++)
{
/* New direction */
new_dir = cycle[chome[prev_dir] + i];
/* New location */
row = py + ddy[prev_dir] + ddy[new_dir];
col = px + ddx[prev_dir] + ddx[new_dir];
/* Visible immovable monsters abort running */
if (cave_m_idx[row][col] > 0)
{
monster_type *m_ptr = &mon_list[cave_m_idx[row][col]];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Visible monster */
if (m_ptr->ml && (r_ptr->flags1 & (RF1_NEVER_MOVE))) return (TRUE);
}
}
|
|
|
|
|
|
#2 | |
|
Angband maintainer
Join Date: Apr 2007
Posts: 968
Donated: $40
![]() |
Quote:
|
|
|
|
|
|
|
#3 | |
|
Veteran
|
Quote:
So does anything else need to be changed? |
|
|
|
|
|
|
#4 |
|
Angband maintainer
Join Date: Apr 2007
Posts: 968
Donated: $40
![]() |
Hm, there should be a ticket for it somewhere, but I can only guess the answer is "no" because I don't remember doing it.
__________________
No, I'm not adding it as an option. |
|
|
|
|
|
#5 |
|
Apprentice
Join Date: May 2009
Posts: 62
![]() |
Hallelujah, cause I lost my last character to a Trapper in the middle of a room. Killt me in 1 step.
-P
__________________
I miss autoscum... but not that much. |
|
|
|
|
|
#6 |
|
Veteran
|
It's ticket #700, and I think I'm failing to understand the changes proposed in this thread. Perhaps what is needed is an additional code block as posted above, which comes before (or after) the existing code block about visible monsters. So that we look one square further away for immobile monsters. Maybe.
|
|
|
|
|
|
#7 |
|
Knight
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 634
Donated: $10
![]() |
Seems like it'd be easier to add something in update_mon() which makes it disturb you whenever you're adjacent to a (visible) monster. (That's what I was going to do to address the same problem)
|
|
|
|
|
|
#8 | |
|
Veteran
|
Quote:
I just don't understand how the OP's code should be applied to the existing code, as it's not in patch format. |
|
|
|
|
|
|
#9 | |
|
Veteran
|
Quote:
Fixed in r1413 - thanks for the patch. |
|
|
|
|
|
|
#10 | |
|
Veteran
Join Date: Mar 2008
Posts: 1,722
![]() |
Quote:
Damned youngsters with perfect vision and attention to detail can't understand the problems of dotards playing while under the influence of one too many Guinness. |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Feature Request: running around still monsters | Donald Jonker | Vanilla | 3 | January 2, 2009 20:25 |
| Sangband running slow on Leopart | vnat | Variants | 0 | November 1, 2008 15:03 |
| Disturbs when running. | Zero | Vanilla | 1 | June 19, 2008 16:30 |
| Problems running Angband | ChodTheWacko | Vanilla | 6 | April 11, 2008 04:18 |
| Anyone running the nightlies... | takkaria | Vanilla | 3 | July 13, 2007 16:54 |