Skip to content

Commit 5044098

Browse files
committed
evolved.id works with negative count parameter
1 parent 0f1012e commit 5044098

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

develop/untests.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ do
5656
end
5757

5858
do
59+
do
60+
local i0 = evo.id(-1)
61+
assert(type(i0) == 'nil')
62+
end
5963
do
6064
local i0 = evo.id(0)
6165
assert(type(i0) == 'nil')

evolved.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3458,7 +3458,7 @@ end
34583458
function __evolved_id(count)
34593459
count = count or 1
34603460

3461-
if count == 0 then
3461+
if count <= 0 then
34623462
return
34633463
end
34643464

0 commit comments

Comments
 (0)