version 1.21 | | version 1.22 |
---|
| | |
/* | | /* |
* static char *rcsid_button_c = | | * static char *rcsid_button_c = |
* "$Id: button.c,v 1.21 2003/09/13 05:01:26 mwedel Exp $"; | | * "$Id: button.c,v 1.22 2003/10/07 07:02:01 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
{ | | { |
object *tmp,*ret=NULL; | | object *tmp,*ret=NULL; |
| | |
| | /* First check the object itself. */ |
| | if((trig->stats.hp && (op->type == trig->stats.hp)) |
| | || (trig->slaying && (op->slaying == trig->slaying)) |
| | || (trig->race && (op->arch->name == trig->race))) |
| | return op; |
| | |
for(tmp=op->inv; tmp; tmp=tmp->below) { | | for(tmp=op->inv; tmp; tmp=tmp->below) { |
if (tmp->inv) { | | if (tmp->inv) { |
ret=check_inv_recursive(tmp, trig); | | ret=check_inv_recursive(tmp, trig); |
if (ret) return ret; | | if (ret) return ret; |
} | | } |
else if((trig->stats.hp && tmp->type == trig->stats.hp) | | else if((trig->stats.hp && (tmp->type == trig->stats.hp)) |
|| tmp->slaying == trig->slaying | | || (trig->slaying && (tmp->slaying == trig->slaying)) |
|| tmp->arch->name == trig->race) | | || (trig->race && (tmp->arch->name == trig->race))) |
return tmp; | | return tmp; |
} | | } |
return NULL; | | return NULL; |