slight optimizations
This commit is contained in:
parent
0fb19d45ad
commit
66d0642006
5 changed files with 77 additions and 71 deletions
|
@ -16,15 +16,15 @@ function temperature(event, conduct, transfer = 0) {
|
|||
|
||||
for (let x = -1; x < 2; x ++) {
|
||||
for (let y = -1; y < 2; y++) {
|
||||
let blok = chunks.getBlock(cx + x, cy + y);
|
||||
let temp = chunks.getBlock(cx, cy, true);
|
||||
let temp2 = chunks.getBlock(cx + x, cy + y, true);
|
||||
|
||||
if (temp2 == undefined || temp == undefined || (x == 0 && y == 0)) {
|
||||
if (temp != undefined) chunks.setBlock(cx, cy, Math.max(temp,-296.15), true);
|
||||
if (temp2 == undefined || temp == undefined || (x == 0 && y == 0) || Math.abs(temp2 - temp) < 0.03) {
|
||||
continue;
|
||||
};
|
||||
|
||||
let blok = chunks.getBlock(cx + x, cy + y);
|
||||
|
||||
let conduct2 = (blok != -1) ? (mainTiles.tiles[blok].attributes.conduct || 0) : 0;
|
||||
|
||||
let conductSum = Math.min(conduct * conduct2 * 10, 0.5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue