From: molivier Date: Wed, 1 Oct 2003 12:36:29 +0000 (+0000) Subject: Fixed/switched the "ev_string" and "ev_field" cases in PR_UglyValueString X-Git-Tag: xonotic-v0.1.0preview~6349 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=75b3d31f22bba33fcf9811f72038bcfcd93597b0;p=xonotic%2Fdarkplaces.git Fixed/switched the "ev_string" and "ev_field" cases in PR_UglyValueString git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3521 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/pr_edict.c b/pr_edict.c index 11acb141..b07b6ec6 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -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;