Merge pull request #328 from hexagonhexagon/better-pipette

Clear cursor when trying to pipette the same building twice.
This commit is contained in:
tobspr 2020-06-28 10:32:09 +02:00 committed by GitHub
commit f8adbcdbec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -322,7 +322,12 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
// Try to extract the building
const extracted = this.hack_reconstructMetaBuildingAndVariantFromBuilding(contents);
if (!extracted) {
// If the building we are picking is the same as the one we have, clear the cursor.
if (
!extracted ||
(extracted.metaBuilding === this.currentMetaBuilding.get() &&
extracted.variant === this.currentVariant.get())
) {
this.currentMetaBuilding.set(null);
return;
}