Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
Bug in one_hit( )
Oct 7, 2017, 2:50 pm
By GatewaySysop
Development
Sep 21, 2017, 11:57 am
By Caius
Seg. Fault / Hang During Color Selection
May 28, 2017, 8:45 am
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Bing

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
476
3,701
19,226
602
ServerFailure
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Bug in mobile_update( )
Forum Rules | Mark all | Recent Posts

Bug in mobile_update( )
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 21, 2017, 11:48 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts363
JoinedMar 7, 2005

Another one that cropped up during play testing. Kind of surprised I didn't see this earlier, nor did anyone else, but I guess most mobbies are supposed to wander. :facepalm:

In update.c, function mobile_update( ) you should see something like this:

      /*
       * 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 ) || ( IS_AFFECTED( ch, AFF_PASS_DOOR ) && !IS_SET( pexit->exit_info, EX_NOPASSDOOR ) ) )
          && !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 ) )


Pretty sure you ought to change like so to avoid unwanted behavior:

      /*
       * Wander 
       */
      if( !xIS_SET( ch->act, ACT_RUNNING )
          && !xIS_SET( ch->act, ACT_SENTINEL )
          && !xIS_SET( ch->act, ACT_NOWANDER )
          && !xIS_SET( ch->act, ACT_PET ) 
          && !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 ) || ( IS_AFFECTED( ch, AFF_PASS_DOOR ) && !IS_SET( pexit->exit_info, EX_NOPASSDOOR ) ) )
          && !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 ) )


I could forgive the omission of ACT_PET, but to have the wandering code not checking the ACT_NOWANDER flag... really? :blink:
       
Post is unread #2 Jan 25, 2017, 3:42 pm
Go to the top of the page
Go to the bottom of the page

Sadiq
Fledgling
GroupMembers
Posts24
JoinedJan 7, 2010

Actually, if I recall correctly, the ACT_NOWANDER flag is basically put in, but not implemented. Making mobs stay in the same room is accomplished with the ACT_SENTINEL flag, which forces the mob to stay in the room, regardless. I *believe* that the original intent of the ACT_NOWANDER flag was to keep the mob stationary until it was attacked, upon which it would be allowed to move (to facilitate hunting aggressors and such, presumably). If this is the case, I think that your fixes should be implemented, but you need to be sure to remove the ACT_NOWANDER flag if the flagged mob is attacked. (not looking at the code atm, but presumably in multi_hit() or one_hit(), or some such).

Adding the ACT_PET flag is good insurance too ;)
       
Post is unread #3 Jan 25, 2017, 4:19 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts363
JoinedMar 7, 2005


Sadiq said:

Actually, if I recall correctly, the ACT_NOWANDER flag is basically put in, but not implemented. Making mobs stay in the same room is accomplished with the ACT_SENTINEL flag, which forces the mob to stay in the room, regardless. I *believe* that the original intent of the ACT_NOWANDER flag was to keep the mob stationary until it was attacked, upon which it would be allowed to move (to facilitate hunting aggressors and such, presumably). If this is the case, I think that your fixes should be implemented, but you need to be sure to remove the ACT_NOWANDER flag if the flagged mob is attacked. (not looking at the code atm, but presumably in multi_hit() or one_hit(), or some such).

Adding the ACT_PET flag is good insurance too ;)


You are exactly correct. ACT_NOWANDER keeps them from wandering via mobile_update( ) but otherwise they can move just fine. If you set a mobile to "nowander" and then set them to, say, mphunt <target> they will set out and do their thing as expected, but otherwise would stay put. The same should be true if they are attacked and the attacker flees, and similar.

From what I can tell, this is about the only missing piece of the implementation. Still shocked it was not in the code.



       
Pages:<< prev 1 next >>