Skip to content

Commit

Permalink
Fix night-vision being activateable without upgrade #1377
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Feb 21, 2015
1 parent 6949672 commit ab96d8f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/tconstruct/client/ArmorControls.java
Expand Up @@ -158,12 +158,13 @@ private void keyPressed(KeyBinding key) {
if (mc.currentScreen == null) {
if (key == ArmorControls.toggleGoggles) {
ItemStack goggles = mc.thePlayer.getCurrentArmor(3);
if (goggles != null && goggles
.getItem() instanceof TravelGear) //TODO: Genericize this
if (goggles != null && goggles.getItem() instanceof TravelGear) //TODO: Genericize this
{
activeGoggles = !activeGoggles;
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
toggleGoggles();
if(goggles.hasTagCompound() && goggles.getTagCompound().getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName()).getBoolean("Night Vision")) {
activeGoggles = !activeGoggles;
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
toggleGoggles();
}
}
}
if (key == ArmorControls.beltSwap) {
Expand Down

0 comments on commit ab96d8f

Please sign in to comment.