Merge branch 'write-color-properly' into 'next'

Fix P_WriteSkincolor

Closes #1068

See merge request STJr/SRB2!2112
This commit is contained in:
Sal 2023-08-20 03:41:51 +00:00
commit 3bcd1dc25a

View file

@ -50,6 +50,7 @@
#include "m_random.h"
#include "dehacked.h" // for map headers
#include "deh_tables.h" // FREE_SKINCOLORS
#include "r_main.h"
#include "m_cond.h" // for emblems
@ -1266,12 +1267,19 @@ static void P_WriteDuplicateText(const char *text, char **target)
static void P_WriteSkincolor(INT32 constant, char **target)
{
const char *color_name;
if (constant <= SKINCOLOR_NONE
|| constant >= (INT32)numskincolors)
return;
if (constant >= SKINCOLOR_FIRSTFREESLOT)
color_name = FREE_SKINCOLORS[constant - SKINCOLOR_FIRSTFREESLOT];
else
color_name = COLOR_ENUMS[constant];
P_WriteDuplicateText(
va("SKINCOLOR_%s", skincolors[constant].name),
va("SKINCOLOR_%s", color_name),
target
);
}