Room=name size increased to allow larger colour codes.

This commit is contained in:
Vatiken 2012-08-11 04:44:23 +00:00
parent 60a2f0ff7b
commit 67129480a4
4 changed files with 41 additions and 3 deletions

View file

@ -820,6 +820,38 @@ int count_color_chars(char *string)
return num;
}
/* Not the prettiest thing I've ever written but it does the task which
* is counting all characters in a string which are not part of the
* protocol system. This is with the exception of detailed MXP codes. */
int count_non_protocol_chars(char * str)
{
int count = 0;
char *string = str;
while (*string) {
if (*string == '\r' || *string == '\n') {
string++;
continue;
}
if (*string == '@' || *string == '\t') {
string++;
if (*string != '[' && *string != '<' && *string != '>' && *string != '(' && *string != ')')
string++;
else if (*string == '[') {
while (*string && *string != ']')
string++;
string++;
} else
string++;
continue;
}
count++;
string++;
}
return count;
}
/** Tests to see if a room is dark. Rules (unless overridden by ROOM_DARK):
* Inside and City rooms are always lit. Outside rooms are dark at sunset and
* night.