Fix: Should not set null if height does not exist

This commit is contained in:
winkidney
2019-03-18 17:20:05 +08:00
committed by Isaac Bythewood
parent 5488927222
commit e1d245f531

View File

@@ -48,7 +48,7 @@ function HeightTable(blockMargin) {
}; };
function get(obj, index) { function get(obj, index) {
if (!obj.data.hasOwnProperty(index)) { if (!obj.data.hasOwnProperty(index)) {
obj.data[index] = null return null
} }
return obj.data[index]; return obj.data[index];
} }
@@ -73,8 +73,8 @@ function HeightTable(blockMargin) {
return height return height
} }
self.get = function(index, value) { self.get = function(index) {
return get(self, index, value); return get(self, index);
}; };
self.set = function (index, value) { self.set = function (index, value) {