Sfoglia il codice sorgente

fix placing a single torch consume more then one torch item

Kolja Strohm 2 anni fa
parent
commit
b816952009
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      FactoryCraft/Entity.cpp

+ 2 - 1
FactoryCraft/Entity.cpp

@@ -4,6 +4,7 @@
 #include "BlockType.h"
 #include "ItemSkill.h"
 #include "EntityRemovedUpdate.h"
+#include "NoBlock.h"
 
 
 ActionTarget::ActionTarget(Vec3<int> blockPos, Direction blockSide)
@@ -44,7 +45,7 @@ void ActionTarget::placeBlock(Entity* zActor, Item* zItem)
 {
 	// TODO: check stamina of actor
 	auto zB = Game::INSTANCE->zBlockAt(blockPos + getDirection(targetBlockSide), zActor->getCurrentDimensionId());
-	if ((zB.isA() && zB.getA()->isPassable()) || (zB.isB() && StaticRegistry<BlockType>::INSTANCE.zElement(zB.getB())->zDefault()->isPassable()))
+	if ((zB.isA() && zB.getA()->zBlockType()->getId() == AirBlockBlockType::ID) || (zB.isB() && zB.isB() == AirBlockBlockType::ID))
 	{
 		Block* block = zItem->zPlacedBlockType()->createBlockAt(blockPos + getDirection(targetBlockSide), zItem);
 		if (block)