Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Bing, DotBot, Sogou

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
638
IgnacioBol
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Bug: mobile_update -fleeing d...
Forum Rules | Mark all | Recent Posts

Bug: mobile_update -fleeing does not check stay_area flag
< Newer Topic :: Older Topic > Inconsistency w/wander behavior

Pages:<< prev 1 next >>
Post is unread #1 Feb 22, 2012, 6:41 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts396
JoinedMar 7, 2005

Another of these things you come upon that makes you scratch your head. I'm not surprised this was never noticed, but it should probably be fixed. :facepalm:

In update.c, mobile_update, you'll find this piece in the /* Flee */ section ...
      if( ch->hit < ch->max_hit / 2
          && ( door = number_bits( 4 ) ) <= 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 ) )


Unlike the /* Wander */ section just above, the /* Flee */ section does not check before potentially moving the mobile into an adjacent area. If the mobile is flagged as stay_area, that restriction will not work. Indeed, not only will they flee into another area, they will never return because they can't wander into another area.

The fix is to simply follow suit with the check in /* Wander */, i.e.

      if( ch->hit < ch->max_hit / 2
          && ( door = number_bits( 4 ) ) <= 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 ) )


And then you're good to go. :cool:
       
Pages:<< prev 1 next >>