--- deliantra/server/common/arch.C 2006/09/14 22:33:58 1.21 +++ deliantra/server/common/arch.C 2006/09/14 23:13:48 1.23 @@ -208,12 +208,8 @@ int item_matched_string (object *pl, object *op, const char *name) { - char * - cp, - local_name[MAX_BUF]; - int - count, - retval = 0; + char *cp, local_name[MAX_BUF]; + int count, retval = 0; strcpy (local_name, name); /* strtok is destructive to name */ @@ -275,7 +271,6 @@ retval = 14; else if (!strncasecmp (cp, query_base_name (op, 1), strlen (cp))) retval = 14; - /* Do substring checks, so things like 'Str+1' will match. * retval of these should perhaps be lower - they are lower * then the specific strcasecmp aboves, but still higher than @@ -287,16 +282,11 @@ retval = 12; else if (strstr (query_short_name (op), cp)) retval = 12; - /* Check against plural/non plural based on count. */ else if (count > 1 && !strcasecmp (cp, op->name_pl)) - { - retval = 6; - } + retval = 6; else if (count == 1 && !strcasecmp (op->name, cp)) - { - retval = 6; - } + retval = 6; /* base name matched - not bad */ else if (strcasecmp (cp, op->name) == 0 && !count) retval = 4; @@ -308,9 +298,11 @@ { if (pl->type == PLAYER) pl->contr->count = count; + return retval; } } + return 0; } @@ -363,8 +355,7 @@ void init_archetable (void) { - archetype * - at; + archetype *at; LOG (llevDebug, " Setting up archetable...\n"); @@ -393,8 +384,7 @@ void dump_all_archetypes (void) { - archetype * - at; + archetype *at; for (at = first_archetype; at != NULL; at = (at->more == NULL) ? at->next : at->more) { @@ -406,11 +396,8 @@ void free_all_archs (void) { - archetype * - at, * - next; - int - i = 0, f = 0; + archetype *at, *next; + int i = 0, f = 0; for (at = first_archetype; at != NULL; at = next) { @@ -445,9 +432,7 @@ void first_arch_pass (object_thawer & fp) { - archetype * - at, * - head = NULL, *last_more = NULL; + archetype *at, *head = NULL, *last_more = NULL; at->clone.arch = first_archetype = at = new archetype; @@ -526,11 +511,8 @@ void second_arch_pass (object_thawer & thawer) { - char - buf[MAX_BUF], * - variable = buf, *argument, *cp; - archetype * - at = NULL, *other; + char buf[MAX_BUF], *variable = buf, *argument, *cp; + archetype *at = NULL, *other; while (fgets (buf, MAX_BUF, thawer) != NULL) { @@ -581,8 +563,7 @@ void check_generators (void) { - archetype * - at; + archetype *at; for (at = first_archetype; at != NULL; at = at->next) if (QUERY_FLAG (&at->clone, FLAG_GENERATOR) && at->clone.other_arch == NULL) @@ -600,8 +581,7 @@ void load_archetypes (void) { - char - filename[MAX_BUF]; + char filename[MAX_BUF]; #if TIME_ARCH_LOAD struct timeval @@ -649,8 +629,7 @@ object * arch_to_object (archetype *at) { - object * - op; + object *op; if (at == NULL) { @@ -677,7 +656,7 @@ object * create_singularity (const char *name) { - object * op; + object *op; char buf[MAX_BUF]; sprintf (buf, "%s (%s)", ARCH_SINGULARITY, name);