- made gender string to integer conversion case insensitive

https://forum.zdoom.org/viewtopic.php?t=64109
This commit is contained in:
alexey.lysiuk 2019-03-30 12:47:34 +02:00
parent f48e0280d8
commit 71caf27039

View file

@ -137,14 +137,23 @@ FString D_UnescapeUserInfo (const char *str, size_t len)
int D_GenderToInt (const char *gender) int D_GenderToInt (const char *gender)
{ {
if (gender[0] == 'f') switch (gender[0])
{
case 'F':
case 'f':
return GENDER_FEMALE; return GENDER_FEMALE;
else if (gender[0] == 'n')
case 'N':
case 'n':
return GENDER_NEUTER; return GENDER_NEUTER;
else if (gender[0] == 'o')
case 'O':
case 'o':
return GENDER_OBJECT; return GENDER_OBJECT;
else
default:
return GENDER_MALE; return GENDER_MALE;
}
} }
int D_PlayerClassToInt (const char *classname) int D_PlayerClassToInt (const char *classname)