Skip to content

Commit 7163200

Browse files
committed
Fix CLuaDrawingDefs::DxDrawCircle client crash (#313)
CLuaDrawingDefs::DxDrawCircle crashed the client when you passed the same start and stop angles. In this fix, the circle is not drawn if the angles are same.
1 parent c762baf commit 7163200

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaDrawingDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ int CLuaDrawingDefs::DxDrawCircle(lua_State* luaVM)
430430
{
431431
const float fMinimumSegments = 3;
432432
const float fMaximumSegments = 1024;
433-
if (fSegments >= fMinimumSegments && fSegments <= fMaximumSegments )
433+
if (fSegments >= fMinimumSegments && fSegments <= fMaximumSegments)
434434
{
435435
const float fMinimumRatio = 0;
436436
const float fMaximumRatio = 100;
437437
if (fRatio > fMinimumRatio && fRatio <= fMaximumRatio)
438438
{
439-
if (fRadius > 0)
439+
if (fRadius > 0 && fStartAngle != fStopAngle)
440440
{
441441
if (fStopAngle < fStartAngle)
442442
std::swap(fStopAngle, fStartAngle);

0 commit comments

Comments
 (0)