Skip to content

Commit b640be6

Browse files
committed
fixed crash
1 parent d39a32a commit b640be6

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

demo/scripts/main.lum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import "core:ui"
44
import "core:document"
55
import "core:world"
66

7-
import "maps/demo/demo" as demo
7+
import "scripts/player" as player
88

99
var g_input : InputSystem = undefined;
1010
var g_world : World = undefined;
1111

1212
fn update(td : f32) : void {
13-
demo.update(td);
13+
player.update(td);
1414

1515
// UI
1616
var ui = g_world.ui();
@@ -21,7 +21,7 @@ fn update(td : f32) : void {
2121
var events = doc.getEvents();
2222
for event in events {
2323
if event.action == "start" {
24-
logError("START");
24+
player.handle_input = true;
2525
}
2626
}
2727
}
@@ -34,5 +34,5 @@ fn init(input : InputSystem) : void {
3434

3535
fn addWorld(world : World) : void {
3636
g_world = world;
37-
demo.init(world, g_input);
37+
player.init(world, g_input);
3838
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "std:math"
1212

1313
var player : ?Entity = null;
1414
var camera_pivot : ?Entity = null;
15-
var handle_input = true;
15+
var handle_input = false;
1616
var forward = false;
1717
var backward = false;
1818
var left = false;

external/lumscript/compiler.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4011,7 +4011,15 @@ struct Checker {
40114011
ref = resolveSymbol(unit, static_cast<IdentifierExpression&>(*member.expression).name, member.name, LookupPolicy::Checked);
40124012
}
40134013
if (ref) {
4014+
if (ref.check_failed) {
4015+
is_writable = false;
4016+
return nullptr;
4017+
}
40144018
is_writable = ref.symbol->kind == Symbol::VARIABLE;
4019+
member.resolved_symbol = ref.symbol;
4020+
if (ref.symbol->expression && ref.symbol->expression->kind == Expression::FUNCTION) {
4021+
member.resolved_fn = static_cast<FunctionExpression*>(ref.symbol->expression);
4022+
}
40154023
expr.resolved_type = unwrapMeta(ref.symbol->resolved_type);
40164024
return &expr;
40174025
}
@@ -5207,7 +5215,7 @@ struct Checker {
52075215
return false;
52085216
}
52095217
if (!import_resolver(import_resolver_userdata, import.path, import.alias, &source)) {
5210-
errorLine({}, "Import not found: ", import.path);
5218+
errorLine({}, "Import not found: ", import.path, " (while importing from ", unit.path, ")");
52115219
return false;
52125220
}
52135221
}

0 commit comments

Comments
 (0)