Merge branch 'master' into awesometnt
Conflicts: src/ChunkMap.cpp
This commit is contained in:
@@ -334,21 +334,33 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel
|
||||
for (size_t i = 0; i < ARRAYCOUNT(gNeighborCoords); i++)
|
||||
{
|
||||
BLOCKTYPE BlockType;
|
||||
NIBBLETYPE BlockMeta;
|
||||
if (!a_Chunk->UnboundedRelGetBlock(a_RelX + gNeighborCoords[i].x, a_RelY + gNeighborCoords[i].y, a_RelZ + gNeighborCoords[i].z, BlockType, BlockMeta))
|
||||
int X = a_RelX + gNeighborCoords[i].x;
|
||||
int Z = a_RelZ + gNeighborCoords[i].z;
|
||||
|
||||
cChunkPtr Neighbour = a_Chunk->GetRelNeighborChunkAdjustCoords(X, Z);
|
||||
if (Neighbour == NULL)
|
||||
{
|
||||
// Neighbor not accessible, ignore it
|
||||
continue;
|
||||
}
|
||||
BlockType = Neighbour->GetBlock(X, a_RelY + gCrossCoords[i].y, Z);
|
||||
|
||||
if (!IsFuel(BlockType))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BlockType == E_BLOCK_TNT)
|
||||
{
|
||||
int AbsX = X + Neighbour->GetPosX() * cChunkDef::Width;
|
||||
int AbsZ = Z + Neighbour->GetPosZ() * cChunkDef::Width;
|
||||
|
||||
m_World.SpawnPrimedTNT(AbsX, a_RelY + gNeighborCoords[i].y, AbsZ, 0);
|
||||
Neighbour->SetBlock(X, a_RelY + gNeighborCoords[i].y, Z, E_BLOCK_AIR, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
bool ShouldReplaceFuel = (m_World.GetTickRandomNumber(MAX_CHANCE_REPLACE_FUEL) < m_ReplaceFuelChance);
|
||||
a_Chunk->UnboundedRelSetBlock(
|
||||
a_RelX + gNeighborCoords[i].x, a_RelY + gNeighborCoords[i].y, a_RelZ + gNeighborCoords[i].z,
|
||||
ShouldReplaceFuel ? E_BLOCK_FIRE : E_BLOCK_AIR, 0
|
||||
);
|
||||
Neighbour->SetBlock(X, a_RelY + gNeighborCoords[i].y, Z, ShouldReplaceFuel ? E_BLOCK_FIRE : E_BLOCK_AIR, 0);
|
||||
} // for i - Coords[]
|
||||
}
|
||||
|
||||
|
||||
@@ -1062,7 +1062,7 @@ void cIncrementalRedstoneSimulator::HandlePressurePlate(int a_BlockX, int a_Bloc
|
||||
{
|
||||
Vector3f EntityPos = a_Entity->GetPosition();
|
||||
Vector3f BlockPos(m_X + 0.5f, (float)m_Y, m_Z + 0.5f);
|
||||
float Distance = (EntityPos - BlockPos).Length();
|
||||
double Distance = (EntityPos - BlockPos).Length();
|
||||
|
||||
if (Distance <= 0.7)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "Simulator.h"
|
||||
#include "../World.h"
|
||||
#include "../Vector3i.h"
|
||||
#include "../BlockID.h"
|
||||
#include "../Defines.h"
|
||||
#include "../Chunk.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../Vector3i.h"
|
||||
#include "../Vector3.h"
|
||||
#include "inifile/iniFile.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user