Fixed LD413

(cherry picked from commit 1e4c2f8aad3d2d48eb408f400fde8e259b40fe18)
This commit is contained in:
Inuyasha 2016-01-07 20:41:58 -08:00
parent 8c17dac589
commit caab150c92
2 changed files with 11 additions and 3 deletions

View File

@ -1451,8 +1451,16 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum)
sd->bottomtexture = get_number(process)-1;
}
M_Memcpy(process,msd->toptexture,8);
sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL);
M_Memcpy(sd->text, process, strlen(process)+1);
process[8] = '\0';
sd->text = Z_Malloc(7, PU_LEVEL, NULL);
// If they type in O_ or D_ and their music name, just shrug,
// then copy the rest instead.
if ((process[0] == 'O' || process[0] == 'D') && process[7])
M_Memcpy(sd->text, process+2, 6);
else // Assume it's a proper music name.
M_Memcpy(sd->text, process, 6);
sd->text[6] = 0;
break;
}
case 414: // Play SFX

View File

@ -2392,7 +2392,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
{
UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture;
strncpy(mapmusname, line->text, 7);
strncpy(mapmusname, sides[line->sidenum[0]].text, 7);
mapmusname[6] = 0;
mapmusflags = tracknum & MUSIC_TRACKMASK;