Skip to content

Commit afdc4e7

Browse files
committed
fix: fix compile
chore: enable /sdl
1 parent e15f84d commit afdc4e7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/legacy/api/SimulatedPlayerAPI.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ Local<Value> PlayerClass::simulateAttack(const Arguments& args) {
9191
if (args.size() == 0) return Boolean::newBoolean(sp->simulateAttack());
9292

9393
if (auto actor = EntityClass::tryExtractActor(args[0])) {
94-
if (!*actor) return Local<Value>();
95-
return Boolean::newBoolean(sp->simulateAttack(*actor));
94+
if (!actor) return Local<Value>();
95+
return Boolean::newBoolean(sp->simulateAttack(actor));
9696
}
9797

9898
LOG_WRONG_ARG_TYPE();
@@ -176,8 +176,8 @@ Local<Value> PlayerClass::simulateInteract(const Arguments& args) {
176176
if (args.size() == 0) return Boolean::newBoolean(sp->simulateInteract());
177177

178178
if (auto actor = EntityClass::tryExtractActor(args[0])) {
179-
if (!*actor) return Local<Value>();
180-
return Boolean::newBoolean(sp->simulateInteract(**actor));
179+
if (!actor) return Local<Value>();
180+
return Boolean::newBoolean(sp->simulateInteract(*actor));
181181
}
182182

183183
int dimid = sp->getDimensionId();
@@ -424,8 +424,8 @@ Local<Value> PlayerClass::simulateLookAt(const Arguments& args) {
424424
lse::getSelfPluginInstance().getLogger().debug("Can't simulate look at other dimension!");
425425
return Boolean::newBoolean(false);
426426
} else if (auto actor = EntityClass::tryExtractActor(args[0])) {
427-
if (!*actor) return Local<Value>();
428-
sp->simulateLookAt(**actor, (sim::LookDuration)lookDuration);
427+
if (!actor) return Local<Value>();
428+
sp->simulateLookAt(*actor, (sim::LookDuration)lookDuration);
429429
return Boolean::newBoolean(true);
430430
}
431431
LOG_WRONG_ARG_TYPE();
@@ -503,8 +503,8 @@ Local<Value> PlayerClass::simulateNavigateTo(const Arguments& args) {
503503
sp->simulateNavigateToLocations(std::move(path), speed);
504504
return Boolean::newBoolean(true);
505505
} else if (auto actor = EntityClass::tryExtractActor(args[0])) {
506-
if (!*actor) return Local<Value>();
507-
auto res = sp->simulateNavigateToEntity(**actor, speed);
506+
if (!actor) return Local<Value>();
507+
auto res = sp->simulateNavigateToEntity(*actor, speed);
508508
return NavigateResultToObject(res);
509509
} else if (IsInstanceOf<IntPos>(args[0]) || IsInstanceOf<FloatPos>(args[0])) {
510510
Vec3 pos = IsInstanceOf<IntPos>(args[0]) ? IntPos::extractPos(args[0])->getBlockPos().bottomCenter()

xmake.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ option("backend")
4545
target("legacy-script-engine")
4646
add_cxflags(
4747
"/EHa",
48-
"/utf-8"
48+
"/utf-8",
49+
"/sdl"
4950
)
5051
add_defines(
5152
"NOMINMAX",

0 commit comments

Comments
 (0)