… | |
… | |
269 | retval = 15; |
269 | retval = 15; |
270 | else if (!strncasecmp (cp, query_base_name (op, 0), strlen (cp))) |
270 | else if (!strncasecmp (cp, query_base_name (op, 0), strlen (cp))) |
271 | retval = 14; |
271 | retval = 14; |
272 | else if (!strncasecmp (cp, query_base_name (op, 1), strlen (cp))) |
272 | else if (!strncasecmp (cp, query_base_name (op, 1), strlen (cp))) |
273 | retval = 14; |
273 | retval = 14; |
274 | |
|
|
275 | /* Do substring checks, so things like 'Str+1' will match. |
274 | /* Do substring checks, so things like 'Str+1' will match. |
276 | * retval of these should perhaps be lower - they are lower |
275 | * retval of these should perhaps be lower - they are lower |
277 | * then the specific strcasecmp aboves, but still higher than |
276 | * then the specific strcasecmp aboves, but still higher than |
278 | * some other match criteria. |
277 | * some other match criteria. |
279 | */ |
278 | */ |
… | |
… | |
281 | retval = 12; |
280 | retval = 12; |
282 | else if (strstr (query_base_name (op, 0), cp)) |
281 | else if (strstr (query_base_name (op, 0), cp)) |
283 | retval = 12; |
282 | retval = 12; |
284 | else if (strstr (query_short_name (op), cp)) |
283 | else if (strstr (query_short_name (op), cp)) |
285 | retval = 12; |
284 | retval = 12; |
286 | |
|
|
287 | /* Check against plural/non plural based on count. */ |
285 | /* Check against plural/non plural based on count. */ |
288 | else if (count > 1 && !strcasecmp (cp, op->name_pl)) |
286 | else if (count > 1 && !strcasecmp (cp, op->name_pl)) |
289 | { |
|
|
290 | retval = 6; |
287 | retval = 6; |
291 | } |
|
|
292 | else if (count == 1 && !strcasecmp (op->name, cp)) |
288 | else if (count == 1 && !strcasecmp (op->name, cp)) |
293 | { |
|
|
294 | retval = 6; |
289 | retval = 6; |
295 | } |
|
|
296 | /* base name matched - not bad */ |
290 | /* base name matched - not bad */ |
297 | else if (strcasecmp (cp, op->name) == 0 && !count) |
291 | else if (strcasecmp (cp, op->name) == 0 && !count) |
298 | retval = 4; |
292 | retval = 4; |
299 | /* Check for partial custom name, but give a real low priority */ |
293 | /* Check for partial custom name, but give a real low priority */ |
300 | else if (op->custom_name && strstr (op->custom_name, cp)) |
294 | else if (op->custom_name && strstr (op->custom_name, cp)) |
… | |
… | |
302 | |
296 | |
303 | if (retval) |
297 | if (retval) |
304 | { |
298 | { |
305 | if (pl->type == PLAYER) |
299 | if (pl->type == PLAYER) |
306 | pl->contr->count = count; |
300 | pl->contr->count = count; |
|
|
301 | |
307 | return retval; |
302 | return retval; |
308 | } |
303 | } |
309 | } |
304 | } |
|
|
305 | |
310 | return 0; |
306 | return 0; |
311 | } |
307 | } |
312 | |
308 | |
313 | /* |
309 | /* |
314 | * Initialises the internal linked list of archetypes (read from file). |
310 | * Initialises the internal linked list of archetypes (read from file). |