1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Remember ternary statements

This commit is contained in:
EmeraldBlock 2020-10-07 21:03:33 -05:00 committed by GitHub
parent 887d41bd06
commit bd8809fcb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,8 +467,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
index = 0;
console.warn("Invalid variant selected:", this.currentVariant.get());
}
const direction =
!this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed * 2 + 1;
const direction = this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed ? -1 : 1;
let newIndex = (index + direction) % availableVariants.length;
if (newIndex < 0) {
newIndex += availableVariants.length;