Skip to content

Commit

Permalink
Added safety check on mobtypes loading entries
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideRei committed Aug 9, 2024
1 parent 1cd07e2 commit 913e7cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/game/uo_files/CUOMobtypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ void CUOMobTypes::Load()

mobTypesRow.m_flags = std::strtol(splitArray[2], NULL, 16);

_mobTypesEntries[animIndex] = mobTypesRow;
if (animIndex <= _mobTypesEntries.size()) //Safety check
{
_mobTypesEntries[animIndex] = mobTypesRow;
}
}
}
csvMobTypes.Close();
Expand Down

0 comments on commit 913e7cf

Please sign in to comment.