This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit a3b64a40eeef9faf2ea3d8bf2927b397e1301910
Author: m4n4t4...@gmail.com 
<m4n4t4...@gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Tue Jan 13 23:25:37 2015 +0000

    All: Fix handling too many characters or aliases in ui (unused)
---
 MP/code/ui/ui_main.c | 22 ++++++++++++----------
 SP/code/ui/ui_main.c | 22 ++++++++++++----------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/MP/code/ui/ui_main.c b/MP/code/ui/ui_main.c
index d9da6b7..9d9f09c 100644
--- a/MP/code/ui/ui_main.c
+++ b/MP/code/ui/ui_main.c
@@ -6372,6 +6372,11 @@ static qboolean Character_Parse(char **p) {
        }
 
        if (token[0] == '{') {
+         if (uiInfo.characterCount == MAX_HEADS) {
+                 uiInfo.characterCount--;
+                 Com_Printf("Too many characters, last character replaced!\n");
+         }
+
          // two tokens per line, character name and sex
          if (!String_Parse(p, 
&uiInfo.characterList[uiInfo.characterCount].name) || !String_Parse(p, 
&tempStr)) {
                return qfalse;
@@ -6387,11 +6392,7 @@ static qboolean Character_Parse(char **p) {
          }
 
          Com_Printf("Loaded %s character %s.\n", tempStr, 
uiInfo.characterList[uiInfo.characterCount].name);
-         if (uiInfo.characterCount < MAX_HEADS) {
-               uiInfo.characterCount++;
-         } else {
-               Com_Printf("Too many characters, last character replaced!\n");
-         }
+         uiInfo.characterCount++;
 
          token = COM_ParseExt(p, qtrue);
          if (token[0] != '}') {
@@ -6427,17 +6428,18 @@ static qboolean Alias_Parse(char **p) {
        }
 
        if (token[0] == '{') {
+         if (uiInfo.aliasCount == MAX_ALIASES) {
+                 uiInfo.aliasCount--;
+                 Com_Printf("Too many aliases, last alias replaced!\n");
+         }
+
          // three tokens per line, character name, bot alias, and preferred 
action a - all purpose, d - defense, o - offense
          if (!String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].name) || 
!String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].ai) || !String_Parse(p, 
&uiInfo.aliasList[uiInfo.aliasCount].action)) {
                return qfalse;
          }
 
          Com_Printf("Loaded character alias %s using character ai %s.\n", 
uiInfo.aliasList[uiInfo.aliasCount].name, 
uiInfo.aliasList[uiInfo.aliasCount].ai);
-         if (uiInfo.aliasCount < MAX_ALIASES) {
-               uiInfo.aliasCount++;
-         } else {
-               Com_Printf("Too many aliases, last alias replaced!\n");
-         }
+         uiInfo.aliasCount++;
 
          token = COM_ParseExt(p, qtrue);
          if (token[0] != '}') {
diff --git a/SP/code/ui/ui_main.c b/SP/code/ui/ui_main.c
index 5e9d6fc..80ef130 100644
--- a/SP/code/ui/ui_main.c
+++ b/SP/code/ui/ui_main.c
@@ -6138,6 +6138,11 @@ static qboolean Character_Parse(char **p) {
                }
 
                if (token[0] == '{') {
+                       if (uiInfo.characterCount == MAX_HEADS) {
+                               uiInfo.characterCount--;
+                               Com_Printf("Too many characters, last character 
replaced!\n");
+                       }
+
                        // two tokens per line, gametype name and sex
                        if (!String_Parse(p, 
&uiInfo.characterList[uiInfo.characterCount].name) || !String_Parse(p, 
&tempStr)) {
                                return qfalse;
@@ -6153,11 +6158,7 @@ static qboolean Character_Parse(char **p) {
                        }
 
                        Com_Printf("Loaded %s character %s.\n", tempStr, 
uiInfo.characterList[uiInfo.characterCount].name);
-                       if (uiInfo.characterCount < MAX_HEADS) {
-                               uiInfo.characterCount++;
-                       } else {
-                               Com_Printf("Too many characters, last character 
replaced!\n");
-                       }
+                       uiInfo.characterCount++;
 
                        token = COM_ParseExt(p, qtrue);
                        if (token[0] != '}') {
@@ -6190,17 +6191,18 @@ static qboolean Alias_Parse(char **p) {
                }
 
                if (token[0] == '{') {
+                       if (uiInfo.aliasCount == MAX_ALIASES) {
+                               uiInfo.aliasCount--;
+                               Com_Printf("Too many aliases, last alias 
replaced!\n");
+                       }
+
                        // three tokens per line, character name, bot alias, 
and preferred action a - all purpose, d - defense, o - offense
                        if (!String_Parse(p, 
&uiInfo.aliasList[uiInfo.aliasCount].name) || !String_Parse(p, 
&uiInfo.aliasList[uiInfo.aliasCount].ai) || !String_Parse(p, 
&uiInfo.aliasList[uiInfo.aliasCount].action)) {
                                return qfalse;
                        }
 
                        Com_Printf("Loaded character alias %s using character 
ai %s.\n", uiInfo.aliasList[uiInfo.aliasCount].name, 
uiInfo.aliasList[uiInfo.aliasCount].ai);
-                       if (uiInfo.aliasCount < MAX_ALIASES) {
-                               uiInfo.aliasCount++;
-                       } else {
-                               Com_Printf("Too many aliases, last alias 
replaced!\n");
-                       }
+                       uiInfo.aliasCount++;
 
                        token = COM_ParseExt(p, qtrue);
                        if (token[0] != '}') {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to