Skip to content

Commit

Permalink
fix: fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Feb 1, 2025
1 parent 84592c4 commit 245b616
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/legacy/api/PlayerAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ Local<Value> PlayerClass::getLastDeathPos() {
}
auto pos = player->getLastDeathPos();
auto dim = player->getLastDeathDimension();
if (!pos.has_value() || !dim.has_value() || dim == -1) {
if (!pos.has_value() || !dim.has_value() || dim->id == -1) {
return Local<Value>();
}
return IntPos::newPos(pos.value(), dim->id);
Expand Down Expand Up @@ -3422,7 +3422,7 @@ Local<Value> PlayerClass::distanceTo(const Arguments& args) {
return Local<Value>();
}

if (player->getDimensionId() != pos.dim) return Number::newNumber(INT_MAX);
if (player->getDimensionId().id != pos.dim) return Number::newNumber(INT_MAX);

return Number::newNumber(player->distanceTo(pos.getVec3()));
}
Expand Down Expand Up @@ -3488,7 +3488,7 @@ Local<Value> PlayerClass::distanceToSqr(const Arguments& args) {
return Local<Value>();
}

if (player->getDimensionId() != pos.dim) return Number::newNumber(INT_MAX);
if (player->getDimensionId().id != pos.dim) return Number::newNumber(INT_MAX);

return Number::newNumber(player->distanceToSqr(pos.getVec3()));
}
Expand Down

0 comments on commit 245b616

Please sign in to comment.