fputs(fh, strcat("author ", MapInfo_Map_author, "\n"));
if(_MapInfo_Map_worldspawn_music != "")
{
- if(
- substring(_MapInfo_Map_worldspawn_music, strlen(_MapInfo_Map_worldspawn_music) - 4, 4) == ".wav"
- ||
- substring(_MapInfo_Map_worldspawn_music, strlen(_MapInfo_Map_worldspawn_music) - 4, 4) == ".ogg"
- )
- fputs(fh, strcat("cdtrack ", substring(_MapInfo_Map_worldspawn_music, 0, strlen(_MapInfo_Map_worldspawn_music) - 4), "\n"));
+ if(strcasecmp(substring(_MapInfo_Map_worldspawn_music, -4, 4), ".wav") == 0 || strcasecmp(substring(_MapInfo_Map_worldspawn_music, -4, 4), ".ogg") == 0)
+ fputs(fh, strcat("cdtrack ", substring(_MapInfo_Map_worldspawn_music, 0, -4), "\n"));
else
fputs(fh, strcat("cdtrack ", _MapInfo_Map_worldspawn_music, "\n"));
}
FIELD_SCALAR(fld, monster_name) \
FIELD_SCALAR(fld, movetype) \
FIELD_SCALAR(fld, move_movetype) \
+ FIELD_SCALAR(fld, music) \
FIELD_SCALAR(fld, netname) \
FIELD_SCALAR(fld, nextthink) \
FIELD_SCALAR(fld, noalign) \
{
// prefer .music over .noise
string chosen_music;
- string oldstuff;
if(world.music)
chosen_music = world.music;
else
chosen_music = world.noise;
- if(
- substring(chosen_music, strlen(chosen_music) - 4, 4) == ".wav"
- ||
- substring(chosen_music, strlen(chosen_music) - 4, 4) == ".ogg"
- )
- oldstuff = strcat(clientstuff, "cd loop \"", chosen_music, "\"\n");
- else
- oldstuff = strcat(clientstuff, "cd loop \"", chosen_music, "\"\n");
- strcpy(clientstuff, oldstuff);
+ string newstuff = strcat(clientstuff, "cd loop \"", chosen_music, "\"\n");
+ strcpy(clientstuff, newstuff);
}
if(whichpack(strcat("maps/", mapname, ".cfg")) != "")