Skip to content

Commit 7c4fe72

Browse files
committed
SkullEntity: Removed occurence of overwriting a variable with a value of a different type
1 parent 02833d8 commit 7c4fe72

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ColinHDev/CSkull/entities/SkullEntity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ public function onChunkPopulated(int $chunkX, int $chunkZ, Chunk $chunk) : void
238238
public function onBlockChanged(Vector3 $block) : void {
239239
// This method is called when a block is changed with World::setBlockAt(), e.g. when a block is broken by an
240240
// explosion. That's why we need to check if this entity can still exist on its position.
241-
$block = $this->getBlockAtPosition();
242-
if (!SkullEntityManager::isBlockValid($block)) {
241+
$blockAtPosition = $this->getBlockAtPosition();
242+
if (!SkullEntityManager::isBlockValid($blockAtPosition)) {
243243
// It can be despawned as it's supporting skull block is broken.
244244
$this->flagForDespawn();
245245
// As the skull block was broken, we can also remove that row from the database.
246-
$position = $block->getPosition();
246+
$position = $blockAtPosition->getPosition();
247247
DataProvider::getInstance()->deleteSkullByPosition(
248248
$position->world->getFolderName(),
249249
$position->x,

0 commit comments

Comments
 (0)