Skip to content

Commit

Permalink
[script] Make self_obj available in program init code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Lysai authored and pingw33n committed May 26, 2020
1 parent fda2fae commit 637a65e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ impl Scripts {
&mut self.db,
&self.proto_db,
ctx);
vm_ctx.self_obj = script.object;
if !script.inited {
debug!("[{:?}#{}] running program initialization code", sid, script.program_id.val());
self.vm.run(script.program, vm_ctx).unwrap()
.assert_no_suspend();
script.inited = true;
}
vm_ctx.self_obj = script.object;
let prg = self.vm.program_state_mut(script.program);
debug!("[{:?}#{}:{}] executing proc {:?} ({:?})",
sid,
Expand Down

0 comments on commit 637a65e

Please sign in to comment.