Use str.resize(size) instead of str = str.substr(0, size) (ty lug <3)

This commit is contained in:
Indev 2025-10-16 15:16:23 +03:00 committed by NepDisk
parent cef5e93c93
commit c4aeef0216

View file

@ -81,7 +81,7 @@ void M_LoadEmotes(UINT16 wadnum)
if (emote_name.size() > MAXEMOTENAME)
{
CONS_Alert(CONS_WARNING, "EMOTES: Emote name is too long, truncating. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
emote_name = emote_name.substr(0, MAXEMOTENAME);
emote_name.resize(MAXEMOTENAME);
}
emote = &emotes[emote_name];
@ -128,7 +128,7 @@ void M_LoadEmotes(UINT16 wadnum)
if (framelumpname.size() > 8)
{
CONS_Alert(CONS_WARNING, "EMOTES: Frame %d name is too long. (file %s, line %d)", numframes, wadfiles[wadnum]->filename, linenum);
framelumpname = framelumpname.substr(0, 8);
framelumpname.resize(8);
}
std::strncpy(emote->frames[numframes], framelumpname.c_str(), framelumpname.size()+1);