1
0
Fork 0

Fix variable naming

The variable “color” was not holding a color, but a pixel.
This commit is contained in:
Nils Dagsson Moskopp 2022-05-21 23:18:22 +02:00
parent 13789550e8
commit 741f9ede21
Signed by untrusted user who does not match committer: erle
GPG Key ID: A3BC671C35191080
1 changed files with 2 additions and 2 deletions

View File

@ -141,8 +141,8 @@ xmaps.create_map_item = function(pos, properties)
if pixels[z][x][1] >= 3 then if pixels[z][x][1] >= 3 then
pixels[z][x] = { 3 + ( z % 2 ) } -- stripes pixels[z][x] = { 3 + ( z % 2 ) } -- stripes
if pixels[z][x][1] == 4 then if pixels[z][x][1] == 4 then
local color = { 4 + ( ( math.floor( x / 7 ) + math.floor( 1.3 * z * z ) ) % 4 ) } local color = 4 + ( ( math.floor( x / 7 ) + math.floor( 1.3 * z * z ) ) % 4 )
pixels[z][x] = color pixels[z][x] = { color }
end end
if z > 1 and pixels[z-1][x][1] < 3 then if z > 1 and pixels[z-1][x][1] < 3 then
pixels[z-1][x] = { 2 } pixels[z-1][x] = { 2 }