version 1.64 | | version 1.65 |
---|
| | |
%{ | | %{ |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: loader.l,v 1.64 2005/08/23 05:42:58 mwedel Exp $"; | | * "$Id: loader.l,v 1.65 2005/08/29 20:18:06 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
static void check_loaded_object(object *op) { | | static void check_loaded_object(object *op) { |
int ip; | | int ip; |
char buf[MAX_BUF], *p; | | |
materialtype_t *mt; | | |
| | |
/* We do some specialized handling to handle legacy cases of name_pl. | | /* We do some specialized handling to handle legacy cases of name_pl. |
* If the object doesn't have a name_pl, we just use the object name - | | * If the object doesn't have a name_pl, we just use the object name - |
| | |
else | | else |
set_materialname(op, 5, NULL); | | set_materialname(op, 5, NULL); |
} | | } |
/* back out the materialname from op->name very limited subset of obs */ | | |
if ((IS_WEAPON(op) || IS_ARMOR(op)) && op->name && op->materialname) { | | |
mt = name_to_material(op->materialname); | | |
if (mt && strstr(op->name, mt->description) && | | |
strstr(op->name, mt->description) == op->name) { | | |
sprintf(buf, "%s", op->name); | | |
p = buf + strlen(mt->description) + 1; | | |
free_string(op->name); | | |
op->name = add_string(p); | | |
sprintf(buf, "%s", op->name_pl); | | |
p = buf + strlen(mt->description) + 1; | | |
free_string(op->name_pl); | | |
op->name_pl = add_string(p); | | |
} | | |
} | | |
/* only do these when program is first run - a bit | | /* only do these when program is first run - a bit |
* excessive to do this at every run - most of this is | | * excessive to do this at every run - most of this is |
* really just to catch any errors - program will still run, but | | * really just to catch any errors - program will still run, but |