TTT-2 / TTT2

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

Bug: Disabled Loadingscreen leads to round not starting #1622

Closed ZenBre4ker closed 1 month ago

ZenBre4ker commented 1 month ago

Your version of TTT2 (mandatory)

Describe the bug (mandatory)

[ttt2] addons/ttt2/lua/ttt2/libraries/loadingscreen.lua:73: attempt to perform arithmetic on field 'timeBegin' (a nil value)

  1. End - addons/ttt2/lua/ttt2/libraries/loadingscreen.lua:73
    1. Prepare - addons/ttt2/lua/ttt2/libraries/gameloop.lua:119
    2. unknown - addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua:594

To reproduce

Steps to reproduce the behaviour:

  1. Disable Loadingscreen
  2. Restart server
  3. Log in
  4. Spawn Bots
  5. Get Error

Expected behaviour

No error

Context (please provide as much as you can)

Apparently the variable loadingscreen.timeBegin is not available, missing initializer? Not sure if there would be any sideeffects by just making a convar check in loadingscreen.end as well or just initializing it. But the code in .end should not be run, if the loading screen was never shown. Otherwise if the screen was shown, that should be called to reset some variables, even if the convar was changed at some point.

TimGoll commented 1 month ago

In the last few months I probably saw 1000 loading screens, how does something like this never happen when testing?