Bug in mobile_update( )
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Jan 22, 2017 1:48 am
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.
In update.c, function mobile_update( ) you should see something like this:
Pretty sure you ought to change like so to avoid unwanted behavior:
I could forgive the omission of ACT_PET, but to have the wandering code not checking the ACT_NOWANDER flag... really?
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?
#2 Jan 25, 2017 5:42 pm
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
Adding the ACT_PET flag is good insurance too
#3 Jan 25, 2017 6:19 pm
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
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 >>