]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fixed/switched the "ev_string" and "ev_field" cases in PR_UglyValueString
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Oct 2003 12:36:29 +0000 (12:36 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Oct 2003 12:36:29 +0000 (12:36 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3521 d7cf8633-e32d-0410-b094-e92efae38249

pr_edict.c

index 11acb1418ebd74db361e6083cf50738809277ffa..b07b6ec6787a532b64f6b78d6200024a7949fd70 100644 (file)
@@ -454,22 +454,10 @@ char *PR_UglyValueString (etype_t type, eval_t *val)
        switch (type)
        {
        case ev_string:
-               snprintf (line, sizeof (line), "%s", PR_GetString(val->string));
-               break;
-       case ev_entity:
-               snprintf (line, sizeof (line), "%i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)));
-               break;
-       case ev_function:
-               f = pr_functions + val->function;
-               snprintf (line, sizeof (line), "%s", PR_GetString(f->s_name));
-               break;
-       case ev_field:
-               def = ED_FieldAtOfs ( val->_int );
-               // LordHavoc: parse the string a bit to turn special characters
+               // Parse the string a bit to turn special characters
                // (like newline, specifically) into escape codes,
                // this fixes saving games from various mods
-               //sprintf (line, "%s", PR_GetString(def->s_name));
-               s = PR_GetString(def->s_name);
+               s = PR_GetString (val->string);
                for (i = 0;i < sizeof (line) - 2 && *s;)
                {
                        if (*s == '\n')
@@ -488,6 +476,17 @@ char *PR_UglyValueString (etype_t type, eval_t *val)
                }
                line[i] = '\0';
                break;
+       case ev_entity:
+               snprintf (line, sizeof (line), "%i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)));
+               break;
+       case ev_function:
+               f = pr_functions + val->function;
+               snprintf (line, sizeof (line), "%s", PR_GetString(f->s_name));
+               break;
+       case ev_field:
+               def = ED_FieldAtOfs ( val->_int );
+               snprintf (line, sizeof (line), ".%s", PR_GetString(def->s_name));
+               break;
        case ev_void:
                snprintf (line, sizeof (line), "void");
                break;