Skip to content

Commit 27894ce

Browse files
committed
Fixed chunk confusion.
1 parent 537612e commit 27894ce

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Nu/Nu/World/WorldBlockMap.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module BlockEditor =
2222
let mutable blockEditor = clear blockEditor entity world
2323
for pass in blockEditor.Passes.Values do
2424
for processor in pass.Processors do
25-
let affine = entity.GetAffineMatrixLocal world
25+
let affine = Affine.make (entity.GetPosition world) (entity.GetRotation world) (entity.GetScale world)
2626
match World.tryProcessChunk affine processor blockEditor.BlockMap.Chunk entity world with
2727
| Some chunk -> blockEditor <- { blockEditor with BlockMap = { blockEditor.BlockMap with Chunk = chunk }}
2828
| None -> ()

Nu/Nu/World/WorldModule.fs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -967,14 +967,13 @@ module WorldModule =
967967
| Some block -> (positionI, block)
968968
| None -> ()|]
969969
|> Map.ofArray
970-
let affine = Affine.Identity
971-
let chunk' = BlockMap.Chunk.make chunkBounds blocks
972-
let chunk'' =
973-
match fn volume affine processor.ProcessParams chunk' with
970+
let subchunk = BlockMap.Chunk.make chunkBounds blocks
971+
let subchunk' =
972+
match fn volume affine processor.ProcessParams subchunk with
974973
| Some effect -> effect entity world
975-
| None -> chunk'
976-
for struct (positionI, block) in chunk''.Blocks.Pairs' do
977-
match BlockMap.Chunk.trySetBlock (chunkBounds.Min + positionI) block chunk'' with
974+
| None -> subchunk
975+
for struct (positionI, block) in subchunk'.Blocks.Pairs' do
976+
match BlockMap.Chunk.trySetBlock (chunkBounds.Min + positionI) block chunk with
978977
| Some chunk' -> chunk <- chunk'
979978
| None -> ()
980979
Some chunk

0 commit comments

Comments
 (0)