Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Yahoo!

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Bug: pass_door not in mob wan...
Forum Rules | Mark all | Recent Posts

Bug: pass_door not in mob wander code
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 18, 2012, 11:39 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

In update.c:
      /*
       * Wander 
       */
      if( !xIS_SET( ch->act, ACT_RUNNING )
          && !xIS_SET( ch->act, ACT_SENTINEL )
          && !xIS_SET( ch->act, ACT_PROTOTYPE )
          && ( door = number_bits( 5 ) ) <= 9
          && ( pexit = get_exit( ch->in_room, door ) ) != NULL
          && pexit->to_room
          && !IS_SET( pexit->exit_info, EX_WINDOW )
          && !IS_SET( pexit->exit_info, EX_CLOSED )
          && !xIS_SET( pexit->to_room->room_flags, ROOM_NO_MOB )
          && !xIS_SET( pexit->to_room->room_flags, ROOM_DEATH )
          && ( !xIS_SET( ch->act, ACT_STAY_AREA ) || pexit->to_room->area == ch->in_room->area ) )
      {


Mobs with pass_door walk through doors, but the wander code never actually makes them try.
       
Post is unread #2 Feb 18, 2012, 2:18 pm   Last edited Feb 18, 2012, 2:20 pm by Aurin
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Updating to this should work:
    /*
     * Wander 
     */
    if(!xIS_SET(ch->act, ACT_RUNNING)
       && !xIS_SET(ch->act, ACT_SENTINEL)
       && !xIS_SET(ch->act, ACT_PROTOTYPE)
       && (door = number_bits(5)) <= 9
       && (pexit = get_exit(ch->in_room, door)) != NULL
       && pexit->to_room
       && !IS_SET(pexit->exit_info, EX_CLOSED)
       && !IS_SET(pexit->to_room->room_flags, ROOM_NO_MOB) 
       && !IS_SET(pexit->to_room->room_flags, ROOM_DEATH) 
       && (!xIS_SET(ch->act, ACT_STAY_AREA) || pexit->to_room->area == ch->in_room->area)
       && (IS_SET(ch->act, AFF_PASS_DOOR) && !IS_SET(pexit->exit_info, EX_NOPASSDOOR))
       
Post is unread #3 Feb 18, 2012, 8:03 pm   Last edited Feb 18, 2012, 9:45 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Am I missing something or don't you actually want something like this instead?

    /*
     * Wander 
     */
    if(!xIS_SET(ch->act, ACT_RUNNING)
       && !xIS_SET(ch->act, ACT_SENTINEL)
       && !xIS_SET(ch->act, ACT_PROTOTYPE)
       && (door = number_bits(5)) <= 9
       && (pexit = get_exit(ch->in_room, door)) != NULL
       && pexit->to_room
       && ( !IS_SET(pexit->exit_info, EX_CLOSED) || (IS_AFFECTED(ch, AFF_PASS_DOOR) && !IS_SET(pexit->exit_info, EX_NOPASSDOOR)) )
       && !IS_SET(pexit->to_room->room_flags, ROOM_NO_MOB) 
       && !IS_SET(pexit->to_room->room_flags, ROOM_DEATH) 
       && (!xIS_SET(ch->act, ACT_STAY_AREA) || pexit->to_room->area == ch->in_room->area)


Unless I read the original too fast, wouldn't it fail because the door is EX_CLOSED, whether or not they could walk through it?

Note, you might also want to apply this in the subsequent "flee" section, so that mobiles can flee through closed exits as well, which would only seem to make sense if they can wander through it, right?
       
Post is unread #4 Feb 19, 2012, 6:11 am
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

good point! lol I completely missed the !IS_SET(pexit->exit_info, EX_CLOSED)
       
Post is unread #5 Feb 19, 2012, 1:02 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Good find :)
       
Pages:<< prev 1 next >>