Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
DotBot, AhrefsBot, Sogou

Members: 0
Guests: 28
Stats
Files
Topics
Posts
Members
Newest Member
488
3,789
19,632
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 22, 2017 1:48 am   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts413
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 5: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 6:19 pm   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts413
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 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 >>