Emotes: only print 'too many frames' warning if we actually get non-empty frame

This commit is contained in:
indev authored and Alug committed 2025-11-18 12:59:06 +01:00
1 parent af2da11933
commit 67bf762b59
1 file changed
+7 -6
+7 -6
View File
@@ -117,12 +117,6 @@ void M_LoadEmotes(UINT16 wadnum)
UINT8 numframes = 0;
auto copy_frame = [&] {
if (numframes == MAXEMOTEFRAMES)
{
CONS_Alert(CONS_WARNING, "EMOTES: Too many frames. (file %s, line %d)", wadfiles[wadnum]->filename, linenum);
return false;
}
size_t list_split = value.find(',');
std::string framelumpname = value.substr(0, list_split);
trim(framelumpname);
@@ -136,6 +130,13 @@ void M_LoadEmotes(UINT16 wadnum)
if (framelumpname.size() == 0)
return false;
// Only print this warning if we actually got new frame
if (numframes == MAXEMOTEFRAMES)
{
CONS_Alert(CONS_WARNING, "EMOTES: Too many frames. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
return false;
}
if (framelumpname.size() > 8)
{
CONS_Alert(CONS_WARNING, "EMOTES: Frame %d name is too long. (file %s, line %d)", numframes, wadfiles[wadnum]->filename, linenum);