
Pages:<< prev 1 next >>


Off the Edge of the Map

GroupAdministrators
Posts1,199
JoinedMar 21, 2006
Bug: Object names can be set to nothing
Danger: Medium - It would make it hard for players to use the objects without names.
Found by: Keberus
Fixed by: Keberus
---
build.c, do_oset
Find:
Change it to:
This will ensure that you can't enter nothing as the name for an object.
Danger: Medium - It would make it hard for players to use the objects without names.
Found by: Keberus
Fixed by: Keberus
---
build.c, do_oset
Find:
if( !str_cmp( arg2, "name" ) ) { if( !can_omodify( ch, obj ) ) return; STRFREE( obj->name ); obj->name = STRALLOC( arg3 ); if( IS_OBJ_STAT( obj, ITEM_PROTOTYPE ) ) { STRFREE( obj->pIndexData->name ); obj->pIndexData->name = QUICKLINK( obj->name ); } return; }
Change it to:
if( !str_cmp( arg2, "name" ) ) { if( !can_omodify( ch, obj ) ) return; if( arg3[0] == '\0' ) { send_to_char( "&WYou &RMUST choose a new name\n\r", ch ); return; } STRFREE( obj->name ); obj->name = STRALLOC( arg3 ); if( IS_OBJ_STAT( obj, ITEM_PROTOTYPE ) ) { STRFREE( obj->pIndexData->name ); obj->pIndexData->name = QUICKLINK( obj->name ); } return; }
This will ensure that you can't enter nothing as the name for an object.
Pages:<< prev 1 next >>