]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
ensure UndoCommand wraps properly at 0
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Feb 2011 12:22:27 +0000 (12:22 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Feb 2011 12:22:27 +0000 (12:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10806 d7cf8633-e32d-0410-b094-e92efae38249

dpsoftrast.c

index 45b62bd67ea9bd20fd10d5414c95a6c9d0d5067b..b43fa29b09495fa56e9edb14721490b9bb1fd5ea 100644 (file)
@@ -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;