hedgewars/uTouch.pas
changeset 11799 bb745219d882
parent 11780 2f8ffd1e1331
child 11821 d8844d4c67de
--- a/hedgewars/uTouch.pas	Tue May 03 19:17:30 2016 +0300
+++ b/hedgewars/uTouch.pas	Tue May 03 19:06:09 2016 +0200
@@ -358,8 +358,10 @@
 var
     xCursor, yCursor, index : LongInt;
 begin
-//Check array sizes
-while Length(fingers) <= pointerCount do
+// check array size
+// note: pointerCount will be incremented later,
+// so at this point it's the index of the new entry
+if Length(fingers) <= pointerCount then
     begin
     setLength(fingers, Length(fingers)*2);
     for index := Length(fingers) div 2 to (Length(fingers)-1) do