version 1.14 | | version 1.15 |
---|
| | |
/* | | /* |
* static char *rcsid_c_range_c = | | * static char *rcsid_c_range_c = |
* "$Id: c_range.c,v 1.14 2006/01/09 02:02:45 cavesomething Exp $"; | | * "$Id: c_range.c,v 1.15 2006/01/10 16:32:44 cavesomething Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
| | |
if(params!=NULL) { | | if(params!=NULL) { |
int i = 0; | | int spellnumber = 0; |
if (i = atoi(params)) | | if (spellnumber = atoi(params)) |
for (spob = op->inv; spob && spob->count != i; spob=spob->below); | | for (spob = op->inv; spob && spob->count != spellnumber; spob=spob->below); |
else spob = lookup_spell_by_name(op, params); | | else spob = lookup_spell_by_name(op, params); |
| | |
if (spob && spob->type == SPELL) { | | if (spob && spob->type == SPELL) { |
/* Now grab any extra data, if there is any. Forward pass | | /* Now grab any extra data, if there is any. Forward pass |
* any 'of' delimiter | | * any 'of' delimiter |
*/ | | */ |
if (strlen(params) > strlen(spob->name)) { | | if (spellnumber) { |
| | /* if we passed a number, the options start at the second word */ |
| | cp = strchr(params, ' '); |
| | if (cp) { |
| | cp++; |
| | if (!strncmp(cp, "of ", 3)) cp+=3; |
| | } |
| | } |
| | else if (strlen(params) > strlen(spob->name)) { |
cp = params + strlen(spob->name); | | cp = params + strlen(spob->name); |
*cp = 0; | | *cp = 0; |
cp++; | | cp++; |