[CF-Devel] Patch submission: item custom name partial match
crossfire-devel-admin at archives.real-time.com
crossfire-devel-admin at archives.real-time.com
Sun Sep 21 11:58:48 CDT 2003
Hello.
My rename patch made it to CVS, but I had missed partial name matching
in item_matched_string
So here's the patch for that. (for common/arch.c)
Pretty straightforward, just added a strstr(op->custom_name,cp)
Note that returned value is 3, meaning partial item name is almost the
lowest priority taken into account.
Nicolas 'Ryo'
-------------- next part --------------
Index: arch.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/common/arch.c,v
retrieving revision 1.26
diff -c -3 -r1.26 arch.c
*** arch.c 13 Sep 2003 05:01:26 -0000 1.26
--- arch.c 21 Sep 2003 16:55:40 -0000
***************
*** 248,253 ****
--- 248,258 ----
else if (strstr(query_base_name(op,1), cp)) retval = 12;
else if (strstr(query_base_name(op,0), cp)) retval = 12;
else if (strstr(query_short_name(op), cp)) retval = 12;
+ /* Check for partial custom name, but give a real low priority */
+ else if (op->custom_name && strstr(op->custom_name, cp)) {
+ pl->contr->count=count; /* May not do anything */
+ retval = 3;
+ }
if (retval) {
if (pl->type == PLAYER)
More information about the crossfire
mailing list