Skip to content

Commit

Permalink
set a fallback when textdraw font is invalid
Browse files Browse the repository at this point in the history
to prevent client crash, issue: #736
  • Loading branch information
AmyrAhmady committed Oct 12, 2023
1 parent 06bd443 commit 8908405
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Server/Components/TextDraws/textdraw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ class TextDrawBase : public T, public PoolIDProvider, public NoCopy

T& setStyle(TextDrawStyle s) override
{
if (static_cast<int>(s) >= 16 || static_cast<int>(s) < 0)
{
style = TextDrawStyle_FontBeckettRegular;
return *this;
}
style = s;
return *this;
}
Expand Down

0 comments on commit 8908405

Please sign in to comment.