1 | /* |
1 | /* |
2 | * static char *rcsid_arch_c = |
2 | * static char *rcsid_arch_c = |
3 | * "$Id: arch.C,v 1.5 2006/08/28 14:05:23 root Exp $"; |
3 | * "$Id: arch.C,v 1.6 2006/08/29 05:03:54 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
158 | return arch_to_object(at); |
158 | return arch_to_object(at); |
159 | } |
159 | } |
160 | } |
160 | } |
161 | return create_singularity(name); |
161 | return create_singularity(name); |
162 | } |
162 | } |
163 | |
|
|
164 | /* GROS - find_best_weapon_used_match and item_matched_string moved there */ |
|
|
165 | object *find_best_weapon_used_match(object *pl, const char *params) |
|
|
166 | { |
|
|
167 | object *tmp, *best=NULL; |
|
|
168 | int match_val=0,tmpmatch; |
|
|
169 | |
|
|
170 | for (tmp=pl->inv; tmp; tmp=tmp->below) { |
|
|
171 | if (tmp->invisible) continue; |
|
|
172 | if ((tmpmatch=item_matched_string(pl, tmp, params))>match_val) |
|
|
173 | { |
|
|
174 | if ((QUERY_FLAG(tmp, FLAG_APPLIED))&&(tmp->type==WEAPON)) |
|
|
175 | { |
|
|
176 | match_val=tmpmatch; |
|
|
177 | best=tmp; |
|
|
178 | }; |
|
|
179 | } |
|
|
180 | } |
|
|
181 | return best; |
|
|
182 | } |
|
|
183 | |
163 | |
184 | /* This is a subset of the parse_id command. Basically, name can be |
164 | /* This is a subset of the parse_id command. Basically, name can be |
185 | * a string seperated lists of things to match, with certain keywords. |
165 | * a string seperated lists of things to match, with certain keywords. |
186 | * pl is the player (only needed to set count properly) |
166 | * pl is the player (only needed to set count properly) |
187 | * op is the item we are trying to match. Calling function takes care |
167 | * op is the item we are trying to match. Calling function takes care |