fix entity delete error

This commit is contained in:
John Alanbrook 2024-09-01 13:59:34 -05:00
parent 794e581336
commit ef0a59f489
4 changed files with 8 additions and 5 deletions

View file

@ -87,7 +87,6 @@ Resources.replstrs = function replstrs(path) {
script = Resources.rm_fn(/debug\.(build|fn_break)/, script);
}
script = script.replace(regexp, function (str) {
var newstr = Resources.replpath(str.trimchr('"'), path);
return `"${newstr}"`;

View file

@ -138,7 +138,10 @@ var entity = {
},
remove_obj(obj) {
delete this.objects[obj.guid];
if (this.objects)
delete this.objects[obj.guid];
else
console.warn(`Object ${this.guid} has no objects file.`);
delete this[obj.name];
Object.unhide(this, obj.name);
},
@ -330,7 +333,8 @@ var entity = {
/* The object needed to store an object as an instance of a master */
instance_obj() {
var t = this.transform();
var t = os.make_transform();
t = this.transform;
t.ur = this.ur.name;
return t;
},

View file

@ -89,6 +89,8 @@ game.engine_start = function (s) {
appcam.transform.pos = [window.size.x,window.size.y,-100];
prosperon.screencolor = render.screencolor();
globalThis.imgui = render.imgui_init();
s();
shape.quad = {

View file

@ -484,8 +484,6 @@ render.init = function() {
poly_ssbo = render.make_textssbo();
sprite_ssbo = render.make_textssbo();
globalThis.imgui = render.imgui_init();
render.textshader = textshader;
os.make_circle2d().draw = function() {