Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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, DotBot, Yandex

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
619
Alexander
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
Posts392
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 >>