SpaxscE / lscs_public

heavily modified recreation of GVP saber system for public use
6 stars 13 forks source link

Halo tries to renders null entity under certain conditions #19

Closed MattJeanes closed 1 year ago

MattJeanes commented 1 year ago

When spawning and 'eating' the force entities e.g. the lightning it can often result in the HoloEnts local table stored in the lscs_force_base.lua file to contain a NULL entity

I temporarily added a simple function just to grab the table from the global context into that file:

function Get_HoloEnts()
    return HoloEnts
end
] lua_run_cl PrintTable(Get_HoloEnts())
1   =   [NULL Entity]

This appears to cause the rendering of certain other things to break, such as world-portals, which in turn breaks multiple other dependent addons such as the TARDIS:

image

After running lua_run_cl Get_HoloEnts()[1]=nil:

image

I'm not sure what other things this might be breaking, but it's definitely an issue.

Apologies about the previous report in #18, we had not completed the full investigation yet as to why exactly the addon was causing issues with ours and jumped to conclusions without testing. We should not have raised that issue.

I believe the issue in your code is in the ENT:OnRemove at the time of removal the entity is still valid so it doesn't set it to nil so when it actually gets deleted it gets set to [NULL Entity] instead and is still added to the halo.Add in your hook.

Thank you

MattJeanes commented 1 year ago

Cheers! 🙂