Skip to content

Commit f6cecd2

Browse files
committed
fix: fix getLastDeathPos
1 parent 24d7058 commit f6cecd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/legacy/api/PlayerAPI.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
#include <mc/world/level/Command.h>
9191
#include <mc/world/level/IConstBlockSource.h>
9292
#include <mc/world/level/biome/Biome.h>
93+
#include <mc/world/level/material/Material.h>
9394
#include <mc/world/scores/Objective.h>
9495
#include <memory>
9596
#include <string>
@@ -673,7 +674,7 @@ Local<Value> PlayerClass::getLastDeathPos() {
673674
}
674675
auto pos = player->getLastDeathPos();
675676
auto dim = player->getLastDeathDimension();
676-
if (!pos.has_value() && !dim.has_value() && dim == -1) {
677+
if (!pos.has_value() || !dim.has_value() || dim == -1) {
677678
return Local<Value>();
678679
}
679680
return IntPos::newPos(pos.value(), dim->id);
@@ -2999,7 +3000,7 @@ Local<Value> PlayerClass::getBlockFromViewVector(const Arguments& args) {
29993000
CHECK_ARG_TYPE(args[3], ValueKind::kBoolean);
30003001
fullOnly = args[3].asBoolean().value();
30013002
}
3002-
HitResult res = actor->traceRay(
3003+
HitResult res = player->traceRay(
30033004
maxDistance,
30043005
false,
30053006
true,

0 commit comments

Comments
 (0)