Merge branch 'next-lc-uint16' into 'next'

Custom skincolor bugfixes

See merge request STJr/SRB2!971
This commit is contained in:
SteelT 2020-06-11 20:08:50 -04:00
commit c810ea3945
2 changed files with 16 additions and 16 deletions

View file

@ -769,7 +769,8 @@ static void readthing(MYFILE *f, INT32 num)
static void readskincolor(MYFILE *f, INT32 num)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word, *word2, *word3;
char *word = s;
char *word2;
char *tmp;
Color_cons_t[num].value = num;
@ -781,32 +782,31 @@ static void readskincolor(MYFILE *f, INT32 num)
if (s[0] == '\n')
break;
// First remove trailing newline, if there is one
tmp = strchr(s, '\n');
if (tmp)
*tmp = '\0';
tmp = strchr(s, '#');
if (tmp)
*tmp = '\0';
if (s == tmp)
continue; // Skip comment lines, but don't break.
word = strtok(s, " ");
if (word)
strupr(word);
// Get the part before the " = "
tmp = strchr(s, '=');
if (tmp)
*(tmp-1) = '\0';
else
break;
strupr(word);
word2 = strtok(NULL, " = ");
if (word2) {
word3 = Z_StrDup(word2);
strupr(word2);
} else
break;
if (word2[strlen(word2)-1] == '\n')
word2[strlen(word2)-1] = '\0';
if (word3[strlen(word3)-1] == '\n')
word3[strlen(word3)-1] = '\0';
// Now get the part after
word2 = tmp += 2;
if (fastcmp(word, "NAME"))
{
deh_strlcpy(skincolors[num].name, word3,
deh_strlcpy(skincolors[num].name, word2,
sizeof (skincolors[num].name), va("Skincolor %d: name", num));
}
else if (fastcmp(word, "RAMP"))

View file

@ -5213,7 +5213,7 @@ void A_SignPlayer(mobj_t *actor)
actor->tracer->color = signcolor;
if (signcolor && signcolor < numskincolors)
signframe += (15 - skincolors[signcolor].invshade);
signframe += (15 - skincolors[facecolor].invshade);
actor->tracer->frame = signframe;
}