BadgerCode / tttdamagelogs

Damagelogs and RDM Manager for Trouble in Terrorist Town (a Garry's Mod gamemode)
GNU General Public License v3.0
20 stars 23 forks source link

Failing to create Report Panel #96

Closed marcandreher closed 1 year ago

marcandreher commented 1 year ago

`[tttdamagelogs-master] lua/includes/extensions/client/panel/scriptedpanels.lua:30: bad argument #2 to 'Create' (Panel expected, got function)

  1. Create - [C]:-1
    1. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:30
    2. AddReport - addons/tttdamagelogs-master/lua/damagelogs/client/rdm_manager.lua:93
      1. BuildReportFrame - addons/tttdamagelogs-master/lua/damagelogs/client/rdm_manager.lua:175
      2. func - addons/tttdamagelogs-master/lua/damagelogs/client/rdm_manager.lua:848
      3. unknown - lua/includes/extensions/net.lua:38 ` Usage: TTT2 Model doesn't open when answering reports
BadgerCode commented 1 year ago

Heyo! What version of the damagelogs are you using?

The version is in the top-bar when you open the damage logs

BadgerCode commented 1 year ago

Looking at the error, it's in some code that hasn't changed for 2 years. So it might be related to a GMod update.

local MessageEntry = vgui.Create("DTextEntry", BuildReportFrame) BuildReportFrame is a function

https://wiki.facepunch.com/gmod/vgui.Create The method doesn't take in a function, so this surely would have not worked for some time

This will require some investigation

wgaylord commented 1 year ago

This is because an update (still sort of in dev builds but the 64-bit beta has it) made some functions start checking argument types instead of ignoring the incorrect types. I went back thru some versions on github and found that originally that function took self as the argument, then during a large update BuildReportFrame ended up there. My guess is it was supposed to be just ReportFrame but it also works properly if you just remove the argument since it gets assigned to the ReportFrame manually a bit lower down.

marcandreher commented 1 year ago

Version: 3.7.0

BadgerCode commented 1 year ago

This has been fixed in #98 and will be included in the next damage logs release

BadgerCode commented 1 year ago

This fix has been released here & on the workshop https://github.com/BadgerCode/tttdamagelogs/releases/tag/v3.8.0