mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-20 22:44:06 +01:00
Fixed a crash bug in oset related to editing unique objects.
This commit is contained in:
parent
2939a3d507
commit
0fd579d3d4
2 changed files with 25 additions and 17 deletions
|
|
@ -488,7 +488,7 @@ bool oset_alias(struct obj_data *obj, char * argument)
|
|||
if (strlen(argument) > max_len)
|
||||
return FALSE;
|
||||
|
||||
if (obj->name && obj->name != obj_proto[i].name)
|
||||
if (i != NOWHERE && obj->name && obj->name != obj_proto[i].name)
|
||||
free(obj->name);
|
||||
|
||||
obj->name = strdup(argument);
|
||||
|
|
@ -559,7 +559,7 @@ bool oset_short_description(struct obj_data *obj, char * argument)
|
|||
if (strlen(argument) > max_len)
|
||||
return FALSE;
|
||||
|
||||
if (obj->short_description && obj->short_description != obj_proto[i].short_description)
|
||||
if (i != NOWHERE && obj->short_description && obj->short_description != obj_proto[i].short_description)
|
||||
free(obj->short_description);
|
||||
|
||||
obj->short_description = strdup(argument);
|
||||
|
|
@ -577,7 +577,7 @@ bool oset_long_description(struct obj_data *obj, char * argument)
|
|||
if (strlen(argument) > max_len)
|
||||
return FALSE;
|
||||
|
||||
if (obj->description && obj->description != obj_proto[i].description)
|
||||
if (i != NOWHERE && obj->description && obj->description != obj_proto[i].description)
|
||||
free(obj->description);
|
||||
|
||||
obj->description = strdup(argument);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue