TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
178 stars 74 forks source link

GetInnocentFilter(false) returns nil or empty table. #615

Closed SebastianL-NT closed 4 years ago

SebastianL-NT commented 4 years ago

Version: GitHub 0.7.2b with #613

Describe: If player has aslay and round begin there is lua error with SendConfirmedTraitors(GetInnocentFilter(false)) (Line ~450 in lua/damagelogs/server/autoslay.lua). Second function should return table with innocents (alive and dead), but there is nothing instead. It will cause lua error and problems with prep2begin timer. It seems to be problem with GetInnocentFilter and it is TTT function.

Steps to reproduce the behaviour:

  1. Aslay one player
  2. Wait for next round
  3. If he is a traitor and got slayed then error will appear. If not go back to 2.

Expected behaviour

There should be no lua error and GetInnocentFilter(false) should return table with innocents.

Context (please provide as much as you can)

Additional context

Logs: (I have tons of "debug" prints, sorry for that mess)

Client "Shrek" connected (31.42.12.91:27005).
ServerLog: 04:19.64 - DMG:   TheItalianStallion [traitor] damaged siubany [innocent] for 57 dmg
ServerLog: 04:20.52 - DMG:   kerus3 keruje [traitor] damaged siubany [innocent] for 36 dmg
*DEAD* xsesamix: Damian ;-;
ServerLog: 04:20.52 - KILL:  kerus3 keruje [traitor] killed siubany [innocent]
-- WIN STATE --> traitors
ServerLog: Round ended.
ServerLog: Result: traitors win.
POINTSHOP2 PERFORMDROPS
DoDrop  Player [7][TheItalianStallion]
DoDrop  Player [15][elo]
ServerLog: PLSBX used ttt_print_damagelog
*DEAD* Julia ジュリア: mowie ze sie kurde odrodzil 
*DEAD* xsesamix: Kurde
--> CleanUP() Start
--> Pre CleanUP 
Bad field in entity!!
--> Post CleanUP 
--> CleanUP() Strip: Julia ジュリア
--> CleanUP() Strip: Karlx casedrop.eu
--> CleanUP() Strip: Berlin
--> CleanUP() Strip: xsesamix
--> CleanUP() Strip: siubany
--> CleanUP() Strip: KajteQ
--> CleanUP() Strip: TheItalianStallion
--> CleanUP() Strip: PLSBX
--> CleanUP() Strip: ADAMik56
--> CleanUP() Strip: oskarkol1
--> CleanUP() Strip: katar502 IES?I
--> CleanUP() Strip: mylek1337
--> CleanUP() Strip: kerus3 keruje
--> CleanUP() Strip: EmilyPen
--> CleanUP() Strip: elo
--> CleanUP() Strip: Mirek spod Monopolowego
--> CleanUP() Strip: Damian7252
--> CleanUP() Strip: [Pingwin] Malina
--> CleanUP() Strip: kiszon1234
--> CleanUP() End
XP preparing
ServerLog: Round proper has begun...
-- DMGLOG --> 
{   -- It is PrintTable and there should be something.
}

[ERROR] lua/damagelogs/server/autoslay.lua:452: attempt to call global 'SendConfirmedTraitors' (a nil value)
  1. fn - lua/damagelogs/server/autoslay.lua:452
   2. Call - lua/ulib/shared/hook.lua:109
    3. unknown - addons/plebs_ttt2_mod/gamemodes/terrortown/gamemode/server/sv_main.lua:1213

Timer Failed! [prep2begin][@addons/plebs_ttt2_mod/gamemodes/terrortown/gamemode/server/sv_main.lua (line 951)]
ServerLog: 00:00.03 - KILL:  katar502 IES?I [traitor] killed katar502 IES?I [traitor]
Alf21 commented 4 years ago

Because this is related to damagelogs and the author refused to work together, the support has stopped. If this has no connection with other problems, there is nothing to do (on our side). Probably the author of damagelogs could help.

Anyways, I gave a look into the problem. It's definitely not caused by GetInnocentFilter because this function always returns a table: https://github.com/TTT-2/TTT2/blob/31a2d7255ae199f03f842b2884a45d598c8560a4/gamemodes/terrortown/gamemode/server/sv_gamemsg.lua#L110

It's caused by the function SendConfirmedTraitors, because this function does not exist in TTT2. It got removed.

Alf21 commented 4 years ago

You could use https://github.com/TTT-2/TTT2/blob/91af1467ab277e4598f9fcf31058a6a68fd01634/gamemodes/terrortown/gamemode/server/sv_networking.lua#L178 instead. But networking roles is a bit complicated.