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
Yandex, CommonCrawl, Bing, Yahoo!

Members: 0
Guests: 11
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 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
Posts367
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
Posts367
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 >>