lzinga / TTTWeightedTraitorSelection

A Garrys Mod TTT addon that improves the traitor selection process
Other
11 stars 6 forks source link

Error when selecting players #9

Closed MinIsMin closed 7 years ago

MinIsMin commented 7 years ago

Sometimes when starting a round, this error occurs and the round doesn't begin.

[ERROR] addons/tttweightsystem/lua/weightsystem/sv_init.lua:174: attempt to index global 'selectedPlayer' (a nil value)
  1. SelectRoles - addons/tttweightsystem/lua/weightsystem/sv_init.lua:174
   2. unknown - gamemodes/terrortown/gamemode/init.lua:655

Timer Failed! [prep2begin][@gamemodes/terrortown/gamemode/init.lua (line 490)]
LaurenceKaye commented 7 years ago

This is one I'm having trouble replicating. I know it happens and I've got some debugging in my personal version, but I haven't managed to make it happen since I put the debug stuff in.

MinIsMin commented 7 years ago

It occurs with "only bots" and "only humans". I'm using SQLite and it happend while playing for some time. (coincidence or not, I don't know)

davidepaci commented 7 years ago

Same happens to me! The bug occurs randomly, and it's starting to get annoying. This addon is fundamental for TTT so I'd be glad if you manage to fix it! :)

janesth commented 7 years ago

Hey man, a friend of mine sent me your mod with the same error. I've been trying to reproduce it, but I'm not sure. For him the bug causes the game to stop; a new round isn't started? I'm trying to find a solution to it. Will do a pull request if I found a way around it. ;)

janesth commented 7 years ago

I have found a solution to the problem, I forked your repository and fixed it. Check this file for the solution. https://github.com/KajTorvaldGrey/TTTWeightedTraitorSelection/blob/master/tttweightsystem/lua/weightsystem/sv_init.lua (line 91-115)

LaurenceKaye commented 7 years ago

Hey if it works it works 🥇 Nice one. Submit a PR and hopefully Izinga will merge it.

davidepaci commented 7 years ago

Holy shit, I love you guys

lzinga commented 7 years ago

I am really glad people enjoy the addon though. Glad I could make your servers better even though my script wasn't 100% working.