mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 00:11:19 +00:00
Prompt page string field length adjustment; check empty named tag before prompt search
This commit is contained in:
parent
e1e94c3af2
commit
a197c19742
3 changed files with 13 additions and 10 deletions
|
@ -1641,11 +1641,11 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
||||||
|
|
||||||
// HACK: Add yellow control char now
|
// HACK: Add yellow control char now
|
||||||
// so the drawing function doesn't call it repeatedly
|
// so the drawing function doesn't call it repeatedly
|
||||||
char name[32];
|
char name[34];
|
||||||
name[0] = '\x82'; // color yellow
|
name[0] = '\x82'; // color yellow
|
||||||
name[1] = 0;
|
name[1] = 0;
|
||||||
strncat(name, word2, 31);
|
strncat(name, word2, 33);
|
||||||
name[31] = 0;
|
name[33] = 0;
|
||||||
|
|
||||||
// Replace _ with ' '
|
// Replace _ with ' '
|
||||||
for (i = 0; i < 32 && name[i]; i++)
|
for (i = 0; i < 32 && name[i]; i++)
|
||||||
|
@ -1728,7 +1728,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "TAG"))
|
else if (fastcmp(word, "TAG"))
|
||||||
strncpy(textprompts[num]->page[pagenum].tag, word2, 25);
|
strncpy(textprompts[num]->page[pagenum].tag, word2, 33);
|
||||||
else if (fastcmp(word, "NEXTPROMPT"))
|
else if (fastcmp(word, "NEXTPROMPT"))
|
||||||
textprompts[num]->page[pagenum].nextprompt = usi;
|
textprompts[num]->page[pagenum].nextprompt = usi;
|
||||||
else if (fastcmp(word, "NEXTPAGE"))
|
else if (fastcmp(word, "NEXTPAGE"))
|
||||||
|
|
|
@ -174,8 +174,8 @@ extern cutscene_t *cutscenes[128];
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char tag[25]; // page tag (24 chars due to texture concatenating)
|
char tag[33]; // page tag
|
||||||
char name[32]; // narrator name
|
char name[34]; // narrator name, extra char for color
|
||||||
char iconname[8]; // narrator icon lump
|
char iconname[8]; // narrator icon lump
|
||||||
boolean rightside; // narrator side, false = left, true = right
|
boolean rightside; // narrator side, false = left, true = right
|
||||||
boolean iconflip; // narrator flip icon horizontally
|
boolean iconflip; // narrator flip icon horizontally
|
||||||
|
|
|
@ -2236,14 +2236,17 @@ void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postex
|
||||||
void F_StartTextPromptByNamedTag(char *tag, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime)
|
void F_StartTextPromptByNamedTag(char *tag, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime)
|
||||||
{
|
{
|
||||||
INT32 promptnum, pagenum;
|
INT32 promptnum, pagenum;
|
||||||
char realtag[25];
|
char realtag[33];
|
||||||
|
|
||||||
strncpy(realtag, tag, 25);
|
if (!tag || !tag[0])
|
||||||
realtag[24] = 0;
|
return;
|
||||||
|
|
||||||
|
strncpy(realtag, tag, 33);
|
||||||
|
realtag[32] = 0;
|
||||||
|
|
||||||
// \todo hardcoded tutorial mode behavior: concat control mode (fps, platform, custom) to end of input tag
|
// \todo hardcoded tutorial mode behavior: concat control mode (fps, platform, custom) to end of input tag
|
||||||
if (tutorialmode)
|
if (tutorialmode)
|
||||||
strncat(realtag, "FPS", 25);
|
strncat(realtag, "FPS", 33);
|
||||||
|
|
||||||
for (promptnum = 0; promptnum < MAX_PROMPTS; promptnum++)
|
for (promptnum = 0; promptnum < MAX_PROMPTS; promptnum++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue