Force user to use the chainable extractor if unlocked.

This commit is contained in:
Gerdon Abbink 2020-06-24 19:47:21 +02:00
parent f43a266fad
commit 5093770329
1 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,8 @@ import { KEYMAPPINGS } from "../../key_action_mapper";
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
import { BaseHUDPart } from "../base_hud_part";
import { SOUNDS } from "../../../platform/sound";
import { MetaMinerBuilding } from "../../buildings/miner";
import { MetaMinerBuilding, enumMinerVariants } from "../../buildings/miner";
import { enumHubGoalRewards } from "../../tutorial_goals";
/**
* Contains all logic for the building placer - this doesn't include the rendering
@ -290,6 +291,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
const tileBelow = this.root.map.getLowerLayerContentXY(tile.x, tile.y);
if (tileBelow) {
this.currentMetaBuilding.set(gMetaBuildingRegistry.findByClass(MetaMinerBuilding));
if (this.root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_miner_chainable)) {
return this.currentVariant.set(enumMinerVariants.chainable);
}
} else {
this.currentMetaBuilding.set(null);
}