make marching ants trailer effect optional

This makes trcolor = bgcolor work even when bgcolor is nil. trcolor=nil always works to produce this behavior.
This commit is contained in:
Kistaro Windrider 2023-08-05 16:39:06 -07:00
parent f4f629d1cd
commit d4a67acc9b
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -378,7 +378,7 @@ ants = {
-- bgcolor=0, --nil: transparent -- bgcolor=0, --nil: transparent
ldcolor=7, ldcolor=7,
fgcolor=6, fgcolor=6,
trcolor=5, -- trcolor=5, --nil: no trailer
speed=2/60, speed=2/60,
offset=0, offset=0,
@ -412,8 +412,8 @@ function ants:draw()
rectfill(x,0,x,h,c) rectfill(x,0,x,h,c)
end end
end end
if p < 1 then
local c = self.trcolor local c = self.trcolor
if p < 1 and c then
for x = x0-1+s,w,s do for x = x0-1+s,w,s do
rectfill(x,0,x,h,c) rectfill(x,0,x,h,c)
end end