» SmaugMuds » Bugfix Lists » AFKMud Bugfix List » AFKMud Bug Archive » [Bug] mposet can cause object...
[Bug] mposet can cause object short descriptions to change mid-script
< Newer Topic
:: Older Topic >
AFKMud 1.77
Pages:<< prev 1 next >>
#1 Sep 10, 2006 4:25 pm
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002
Bug: mposet can cause object short descriptions to change mid-script
Danger: Trivial - Can only happen under very restricted conditions.
Discovered in: AFKMud 1.77
Found by: Valcados
Fixed by: Valcados
---
mud.h
Locate:
Below that, add:
db.c
Locate:
Below that, add:
mud_prog.c, release_supermob
Replace the function with:
mud_prog.c, set_supermob
Locate:
Below that, add:
mud_comm.c, do_mposet
Locate:
Below that, add:
The conditions by which an object processing a program can have the short description changed are pretty narrow. The object itself would have to call do_mposet and would then need to be altering its short description field. Doing so under these specific circumstances would cause the supermob to act out for the object under its old short description. Changing the short description by any other means is highly unlikely to affect the supermob.
Danger: Trivial - Can only happen under very restricted conditions.
Discovered in: AFKMud 1.77
Found by: Valcados
Fixed by: Valcados
---
mud.h
Locate:
extern CHAR_DATA *supermob;
Below that, add:
extern OBJ_DATA *supermob_obj;
db.c
Locate:
AUCTION_DATA *auction; /* auctions */
Below that, add:
OBJ_DATA *supermob_obj;
mud_prog.c, release_supermob
Replace the function with:
void release_supermob( ) { supermob_obj = NULL; char_from_room( supermob ); if( !char_to_room( supermob, get_room_index( ROOM_VNUM_POLY ) ) ) log_printf( "char_to_room: %s:%s, line %d.", __FILE__, __FUNCTION__, __LINE__ ); if( IS_ACT_FLAG( supermob, ACT_ONMAP ) ) { REMOVE_ACT_FLAG( supermob, ACT_ONMAP ); supermob->map = -1; supermob->x = -1; supermob->y = -1; } }
mud_prog.c, set_supermob
Locate:
if( !obj ) return;
Below that, add:
supermob_obj = obj;
mud_comm.c, do_mposet
Locate:
STRFREE( obj->short_descr ); obj->short_descr = STRALLOC( arg3 );
Below that, add:
if( obj == supermob_obj ) { STRFREE( supermob->short_descr ); supermob->short_descr = QUICKLINK( obj->short_descr ); }
The conditions by which an object processing a program can have the short description changed are pretty narrow. The object itself would have to call do_mposet and would then need to be altering its short description field. Doing so under these specific circumstances would cause the supermob to act out for the object under its old short description. Changing the short description by any other means is highly unlikely to affect the supermob.
Pages:<< prev 1 next >>