Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

Invalid Panels should not error when printed. #1983

Closed Bo98 closed 9 years ago

Bo98 commented 9 years ago

Invalid Entities don't error when printed.

] lua_run_cl p = vgui.Create("DPanel") p:Remove()
] lua_run_cl print(p)
[ERROR] Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
  1. unknown - [C]:-1
   2. print - [C]:-1
    3. unknown - LuaCmd:1
] lua_run_cl print(Entity(-1))
[NULL Entity]

Might expand to other types.

robotboy655 commented 9 years ago

Will be fixed for Panels & Phys Objects.

Ideally this fix should be applied to all methods of those classes, but I'll need to study the shit a bit more. The c++ side of Garry's Mod has a shit ton inconsistencies, just like Lua side does.