From e6e4d7ae203f906345b44725db812e78029a070e Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Mon, 3 Jul 2023 04:05:21 +0000 Subject: [PATCH] up --- source/engine/yugine.c | 2 ++ source/scripts/engine.js | 41 +++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/source/engine/yugine.c b/source/engine/yugine.c index 1fe366e..afeeeac 100644 --- a/source/engine/yugine.c +++ b/source/engine/yugine.c @@ -128,6 +128,8 @@ int main(int argc, char **args) { script_startup(); + logout = 0; + for (int i = 1; i < argc; i++) { if (args[i][0] == '-') { switch (args[i][1]) { diff --git a/source/scripts/engine.js b/source/scripts/engine.js index d4c5256..8b44bf9 100644 --- a/source/scripts/engine.js +++ b/source/scripts/engine.js @@ -962,7 +962,7 @@ var Register = { }, unregister_obj(obj) { -// Log.warn(`Unregister ${JSON.stringify(obj)}`); + Log.warn(`Unregister ${JSON.stringify(obj.body)}`); this.updates = this.updates.filter(x => x[1] !== obj); this.guis = this.guis.filter(x => x[1] !== obj); this.nk_guis = this.nk_guis.filter(x => x[1] !== obj); @@ -2087,33 +2087,36 @@ var gameobject = { obj.sync(); obj.defn('components', {}); + Log.warn(`Made an object with ID ${obj.body}`); + cmd(113, obj.body, obj); complete_assign(obj, { - set scale(x) { cmd(36, this.body, x); }, - get scale() { return cmd(103, this.body); }, - get flipx() { return cmd(104,this.body); }, - set flipx(x) { cmd(55, this.body, x); }, - get flipy() { return cmd(105,this.body); }, - set flipy(x) { cmd(56, this.body, x); }, + set scale(x) { + Log.warn(obj.body); cmd(36, obj.body, x); }, + get scale() { return cmd(103, obj.body); }, + get flipx() { return cmd(104,obj.body); }, + set flipx(x) { cmd(55, obj.body, x); }, + get flipy() { return cmd(105,obj.body); }, + set flipy(x) { cmd(56, obj.body, x); }, - get angle() { return Math.rad2deg(q_body(2,this.body))%360; }, - set angle(x) { set_body(0,this.body, Math.deg2rad(x)); }, + get angle() { return Math.rad2deg(q_body(2,obj.body))%360; }, + set angle(x) { set_body(0,obj.body, Math.deg2rad(x)); }, - set pos(x) { set_body(2,this.body,x); }, - get pos() { return q_body(1,this.body); }, + set pos(x) { set_body(2,obj.body,x); }, + get pos() { return q_body(1,obj.body); }, - get elasticity() { return cmd(107,this.body); }, - set elasticity(x) { cmd(106,this.body,x); }, + get elasticity() { return cmd(107,obj.body); }, + set elasticity(x) { cmd(106,obj.body,x); }, - get friction() { return cmd(109,this.body); }, - set friction(x) { cmd(108,this.body,x); }, + get friction() { return cmd(109,obj.body); }, + set friction(x) { cmd(108,obj.body,x); }, - set mass(x) { set_body(7,this.body,x); }, - get mass() { return q_body(5, this.body); }, + set mass(x) { set_body(7,obj.body,x); }, + get mass() { return q_body(5, obj.body); }, - set phys(x) { set_body(1, this.body, x); }, - get phys() { return q_body(0,this.body); }, + set phys(x) { set_body(1, obj.body, x); }, + get phys() { return q_body(0,obj.body); }, }); for (var prop in obj) {