Fix P_WriteSkincolor

This commit is contained in:
Sally Coolatta 2023-08-19 23:39:54 -04:00
parent b6f41bd7b8
commit d589953fc4

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
);
}