X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fworld.cpp;h=e4fb968ddfbb8014004a2b7a6a7647be53b2c2a5;hb=04531ab5fc3d82ba5b5d456bcc277fe6499e1150;hp=8ea99fec247734e6b592c6e65fc231f9350a49c7;hpb=5178dd1e226d45db7ae61e3d7d6866dc4254d9ae;p=blank.git diff --git a/src/world/world.cpp b/src/world/world.cpp index 8ea99fe..e4fb968 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -136,6 +136,19 @@ Player::~Player() { } +bool Player::SuitableSpawn(BlockLookup &spawn_block) const noexcept { + if (!spawn_block || spawn_block.GetType().collide_block) { + return false; + } + + BlockLookup head_block(spawn_block.Next(Block::FACE_UP)); + if (!head_block || head_block.GetType().collide_block) { + return false; + } + + return true; +} + void Player::Update(int dt) { chunks.Rebase(entity.ChunkCoords()); }