host_cmd.c (ExtraMaps_Add): Fix the list sorting.

(Modlist_Add): Likewise.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@90 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-02-27 09:03:22 +00:00
parent b15b30ec6f
commit 4a68c9c35e

View file

@ -231,7 +231,7 @@ void ExtraMaps_Add (char *name)
strcpy (level->name, name);
//insert each entry in alphabetical order
if (extralevels == NULL || Q_strcasecmp(level->name, extralevels->name) > 0) //insert at front
if (extralevels == NULL || Q_strcasecmp(level->name, extralevels->name) < 0) //insert at front
{
level->next = extralevels;
extralevels = level;
@ -240,7 +240,7 @@ void ExtraMaps_Add (char *name)
{
prev = extralevels;
cursor = extralevels->next;
while (cursor && (Q_strcasecmp(level->name, cursor->name) < 0))
while (cursor && (Q_strcasecmp(level->name, cursor->name) > 0))
{
prev = cursor;
cursor = cursor->next;
@ -363,7 +363,7 @@ void Modlist_Add (char *name)
strcpy (mod->name, name);
//insert each entry in alphabetical order
if (modlist == NULL || Q_strcasecmp(mod->name, modlist->name) > 0) //insert at front
if (modlist == NULL || Q_strcasecmp(mod->name, modlist->name) < 0) //insert at front
{
mod->next = modlist;
modlist = mod;
@ -372,7 +372,7 @@ void Modlist_Add (char *name)
{
prev = modlist;
cursor = modlist->next;
while (cursor && (Q_strcasecmp(mod->name, cursor->name) < 0))
while (cursor && (Q_strcasecmp(mod->name, cursor->name) > 0))
{
prev = cursor;
cursor = cursor->next;