Go Back   Angband Forums > Angband > Vanilla

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old May 23, 2013, 10:09   #1
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,847
PowerWyrm is on a distinguished road
[3.5-dev] Monster opening/bashing refactoring

Monster opening:

if (cave_iscloseddoor(cave, ny, nx) || cave_issecretdoor(cave, ny, nx))
    cave_open_door(c, ny, nx);
else if (cave_islockeddoor(cave, ny, nx))

    /* Handle viewable doors */
    if (player_has_los_bold(ny, nx))
         do_view = TRUE;
First problem: cave_iscloseddoor() defined in cave.c includes locked doors, so the "else" part is dead code; I think cave_iscloseddoor() should only define "closed non locked" doors so monsters don't open locked doors without a lock power check (I think there are similar problems elsewhere in the code where the wrong check is made).

Second problem: refreshing display (do_view) should be called when the door is opened, not when a monster only "fiddles" with a lock; so the corresponding code should be put in the "if" part, not the "else" part.

Monster bashing:

else if (rf_has(m_ptr->race->flags, RF_BASH_DOOR))
    bash door...
This means that monsters having both OPEN_DOOR and BASH_DOOR will always try to open a door instead of bashing it, making BASH_DOOR obsolete. Before the refactoring, monsters failing to unlock a door would try to bash it.
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm 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
Angband 3.5-dev Magnate Vanilla 70 July 2, 2012 16:47
V 3.4 dev new version takkaria Vanilla 1 March 23, 2012 12:19
Compling with Dev-C++ PaulBlay Development 6 December 15, 2009 22:32
Merge in 3.0.9e changes with dev. Irashtar Vanilla 22 September 18, 2008 19:01
Opening a savefile in Windows Zero Vanilla 13 June 28, 2008 05:55

All times are GMT +1. The time now is 10:06.

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