version 1.10 | | version 1.11 |
---|
| | |
/* | | /* |
* static char *rcsid_utils_c = | | * static char *rcsid_utils_c = |
* "$Id: utils.c,v 1.10 2003/02/14 05:50:29 garbled Exp $"; | | * "$Id: utils.c,v 1.11 2003/05/21 07:31:13 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if (op->materialname != NULL) | | if (op->materialname != NULL) |
return; | | return; |
| | |
| | |
| | |
if (nmt == NULL) { | | if (nmt == NULL) { |
lmt = NULL; | | lmt = NULL; |
| | #ifndef NEW_MATERIAL_CODE |
| | for (mt = materialt; mt != NULL && mt->next != NULL; mt=mt->next) { |
| | if (op->material & mt->material) { |
| | lmt = mt; |
| | break; |
| | } |
| | } |
| | |
| | #else |
for (mt = materialt; mt != NULL && mt->next != NULL; mt=mt->next) { | | for (mt = materialt; mt != NULL && mt->next != NULL; mt=mt->next) { |
if (op->material & mt->material && rndm(1, 100) <= mt->chance && | | if (op->material & mt->material && rndm(1, 100) <= mt->chance && |
difficulty >= mt->difficulty && | | difficulty >= mt->difficulty && |
| | |
break; | | break; |
} | | } |
} | | } |
| | #endif |
} else { | | } else { |
lmt = nmt; | | lmt = nmt; |
} | | } |
| | |
if (lmt != NULL) { | | if (lmt != NULL) { |
| | #ifndef NEW_MATERIAL_CODE |
| | op->materialname = add_string(lmt->name); |
| | return; |
| | #endif |
| | |
if (op->stats.dam && IS_WEAPON(op)) { | | if (op->stats.dam && IS_WEAPON(op)) { |
op->stats.dam += lmt->damage; | | op->stats.dam += lmt->damage; |
if (op->stats.dam < 1) | | if (op->stats.dam < 1) |