Save on room change
parent
105d7d3395
commit
50060dfa33
|
@ -329,7 +329,11 @@ export fn update() void {
|
||||||
if (shouldSave) save();
|
if (shouldSave) save();
|
||||||
}
|
}
|
||||||
|
|
||||||
camera = @divTrunc(util.world2cell(player.pos.pos), @splat(2, @as(i32, 20))) * @splat(2, @as(i32, 20));
|
const newCamera = @divTrunc(util.world2cell(player.pos.pos), @splat(2, @as(i32, 20))) * @splat(2, @as(i32, 20));
|
||||||
|
if (!@reduce(.And, newCamera == camera)) {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
camera = newCamera;
|
||||||
|
|
||||||
map.draw(camera);
|
map.draw(camera);
|
||||||
circuit.draw(camera);
|
circuit.draw(camera);
|
||||||
|
|
Loading…
Reference in New Issue