From: eihrul Date: Sat, 5 Feb 2011 12:22:27 +0000 (+0000) Subject: ensure UndoCommand wraps properly at 0 X-Git-Tag: xonotic-v0.5.0~438^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=54197bdf4f11fdacb7a7cf4359398be468ec2ba8;p=xonotic%2Fdarkplaces.git ensure UndoCommand wraps properly at 0 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10806 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/dpsoftrast.c b/dpsoftrast.c index 45b62bd6..b43fa29b 100644 --- a/dpsoftrast.c +++ b/dpsoftrast.c @@ -850,6 +850,8 @@ static void DPSOFTRAST_UndoCommand(int size) int freecommand = dpsoftrast.commandpool.freecommand; int usedcommands = dpsoftrast.commandpool.usedcommands; freecommand -= size; + if (freecommand < 0) + freecommand += DPSOFTRAST_DRAW_MAXCOMMANDPOOL; usedcommands -= size; dpsoftrast.commandpool.freecommand = freecommand; dpsoftrast.commandpool.usedcommands = usedcommands;