1
0

Gives all entities the default airlevel on creation (#3942)

* Guardians don't take damage on land
* Squids suffocate on land
This commit is contained in:
Bond-009
2017-08-25 15:44:36 +02:00
committed by Alexander Harkness
parent 4b84288801
commit 3c8712d871
3 changed files with 30 additions and 17 deletions

View File

@@ -42,20 +42,11 @@ void cGuardian::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
// that is not where the entity currently resides (FS #411)
Vector3d Pos = GetPosition();
// TODO: Not a real behavior, but cool :D
int RelY = FloorC(Pos.y);
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
return;
}
int RelX = FloorC(Pos.x) - a_Chunk.GetPosX() * cChunkDef::Width;
int RelZ = FloorC(Pos.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
BLOCKTYPE BlockType;
if (a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockType) && !IsBlockWater(BlockType) && !IsOnFire())
{
// Burn for 10 ticks, then decide again
StartBurning(10);
}
super::Tick(a_Dt, a_Chunk);
}