Skip to content

Commit

Permalink
Closed #23: alveary does not see the sky
Browse files Browse the repository at this point in the history
  • Loading branch information
DDShadowRU committed Jan 10, 2022
1 parent e49990f commit 142ccb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dev/apiculture/alveary/misc/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ TileEntity.registerPrototype(BlockID.alveary_misc_center, {
this.house.getClimate = function () {
return self.climate;
};

this.house.canSeeSky = function () {
return GenerationUtils.canSeeSky(self.x, self.y + 2, self.z);
};
}

var Modifiers = new ModifierList([]);
Expand Down
6 changes: 5 additions & 1 deletion dev/apiculture/api/BeeHouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function BeeHouse(tile, slots, houseModifierList) {
this.error = Translation.translate("apiary.error.climate");
} else if (!this.queen.isValidHumidity(this.getHumidity())) {
this.error = Translation.translate("apiary.error.humidity");
} else if (!GenerationUtils.canSeeSky(this.tile.x, this.tile.y + 1, this.tile.z) && !modifiersList.isSelfLighted() && !this.houseModifierList.isSelfLighted() && !this.queen.getActiveChromosome("CAVE_DWELLING")) {
} else if (!this.canSeeSky() && !modifiersList.isSelfLighted() && !this.houseModifierList.isSelfLighted() && !this.queen.getActiveChromosome("CAVE_DWELLING")) {
this.error = Translation.translate("apiary.error.sky");
} else if (World.getWeather().rain > 0 && !modifiersList.isSealed() && !houseModifierList.isSealed() && !this.queen.getActiveChromosome("TOLERATES_RAIN")) {
this.error = Translation.translate("apiary.error.rain");
Expand Down Expand Up @@ -131,6 +131,10 @@ function BeeHouse(tile, slots, houseModifierList) {

//Функции для перегрузки

this.canSeeSky = function () {
return GenerationUtils.canSeeSky(this.tile.x, this.tile.y + 1, this.tile.z);
};

this.getPrincessSlot = function (slotname) {
return this.getContainer().getSlot(slotname);
};
Expand Down

0 comments on commit 142ccb5

Please sign in to comment.