- fix compile on vs2017, change pow2char to static

- include nullptr check for mapname in music.cpp
This commit is contained in:
Rachael Alexanderson 2019-11-13 16:40:08 -05:00
parent 7f3d00446d
commit 5002dd866c
2 changed files with 2 additions and 2 deletions

View file

@ -1095,7 +1095,7 @@ CONSTEXPR size_t logbasenegative(T n)
static CONSTEXPR const char pow2char[8] = {1,2,4,8,16,32,64,128u};
#else
// Revert the above to a real bit shift through some C++ operator magic. That saves me from reverting all the code that uses this construct.
struct
static struct
{
constexpr uint8_t operator[](int index) const { return 1 << index; };
} pow2char;

View file

@ -566,7 +566,7 @@ int Mus_Play(const char *mapname, const char *fn, bool loop)
return 0;
}
// A restart was requested. Ignore the music name being passed and just try tp restart what got here last.
if (*mapname == '*')
if (mapname && *mapname == '*')
{
mapname = lastMusicLevel.GetChars();
fn = lastMusic.GetChars();