Browse Source

fix compiler issues

Kolja Strohm 3 years ago
parent
commit
0e957111a0

+ 1 - 1
FactoryCraft/BasicBlock.cpp

@@ -2,7 +2,7 @@
 
 
 BasicBlock::BasicBlock( BlockType *zType, ItemType *zTool, Framework::Vec3<int> pos )
-    : Block( zType, zTool, pos )
+    : Block( zType, zTool, pos, false )
 {}
 
 bool BasicBlock::onTick( TickQueue *zQueue, int numTicks, bool &blocked )

+ 2 - 2
FactoryCraft/Block.cpp

@@ -1,8 +1,8 @@
 #include "Block.h"
 #include "Inventory.h"
 
-Block::Block( const BlockType *zType, ItemType *zTool, Framework::Vec3<int> pos )
-    : Inventory( pos )
+Block::Block( const BlockType *zType, ItemType *zTool, Framework::Vec3<int> pos, bool hasInventory )
+    : Inventory( pos, hasInventory )
 {
     transparent = false;
     passable = false;

+ 1 - 1
FactoryCraft/Block.h

@@ -57,7 +57,7 @@ protected:
     virtual void onPostTick() = 0;
 
 public:
-    Block( const BlockType *zType, ItemType *zTool, Framework::Vec3<int> pos );
+    Block( const BlockType *zType, ItemType *zTool, Framework::Vec3<int> pos, bool hasInventory );
     virtual ~Block();
 
     void tick( TickQueue *zQueue );

+ 1 - 1
FactoryCraft/Chunk.cpp

@@ -36,7 +36,7 @@ Chunk::~Chunk()
 
 Block *Chunk::zBlockNeighbor( Framework::Vec3<int> location )
 {
-    if( location.x >= 0 && location.x < CHUNK_SIZE && location.y <= 0 && location.y < CHUNK_SIZE && location.z >= 0 && location.z < WORLD_HEIGHT )
+    if( location.x >= 0 && location.x < CHUNK_SIZE && location.y >= 0 && location.y < CHUNK_SIZE && location.z >= 0 && location.z < WORLD_HEIGHT )
         return blocks[ (location.x * CHUNK_SIZE + location.y) * WORLD_HEIGHT + location.z ];
     if( location.z >= 0 && location.z < WORLD_HEIGHT )
         return zGame->zBlockAt( { location.x + this->location.x - CHUNK_SIZE / 2, location.y + this->location.y - CHUNK_SIZE / 2, location.z }, dimensionId );

+ 1 - 1
FactoryCraft/Entity.cpp

@@ -1,7 +1,7 @@
 #include "Entity.h"
 
 Entity::Entity( const EntityType *zType, Framework::Vec3<float> location, int dimensionId, int entityId )
-    : Inventory( location ),
+    : Inventory( location, true ),
     speed( 0, 0, 0 ),
     faceDir( 1, 0 ),
     zEntityType( zType ),