thebigsleepjoe / TTT-Bots-2

Player bots for Garry's Mod TTT
Creative Commons Attribution Share Alike 4.0 International
10 stars 2 forks source link

[BUG] null entity reference in personality #26

Closed EntranceJew closed 7 months ago

EntranceJew commented 7 months ago

Game version/server type

Describe the bug

Bots throw error unexpectedly.

Stack trace/error

The error, if any. Example:

ServerLog: Round ended.
ServerLog: Result: traitors wins.
ServerLog: Round proper has begun...
ServerLog: 00:00.02 - KILL:  [BOT] PIMPIN' PIGEON [innocent] killed [BOT] PIMPIN' PIGEON [innocent]
Dropped [BOT] PIMPIN' PIGEON from server (Disconnect by user)

[ttt-bots-2] addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:243: Tried to use a NULL entity!
  1. GetPos - [C]:-1
   2. GetAllWitnessesBasic - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:243
    3. unknown - addons/ttt-bots-2/lua/tttbots2/components/sv_personality.lua:548

Timer Failed! [TTTBots.Personality.RDM][@addons/ttt-bots-2/lua/tttbots2/components/sv_personality.lua (line 532)]
[BOT] hotdogglemin: corpse

⚠️ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Play round.
  2. Bots do their thing.
  3. See error

Expected behavior

Bots don't have errors.

thebigsleepjoe commented 7 months ago

Is this an RDM-specific error?

EntranceJew commented 7 months ago

I dunno, I was tabbed out looking at logs. I assume I was dead already.

thebigsleepjoe commented 7 months ago

Oh you're also on an outdated version, I'd recommend the steam version. It's at 1.0 now!

EntranceJew commented 7 months ago

After switching to the workshop version:

[TTT Bots 2.0] lua/tttbots2/behaviors/sv_attacktarget.lua:378: Tried to use a NULL entity!
  1. unknown - lua/tttbots2/sh_tttbots2.lua:129

I ran r_flushlod on a client in an inopportune time and it blackscreened my client, and all the bots on the server started spewing this message, there was basically nothing else in the server log except for this.

thebigsleepjoe commented 7 months ago

I made a commit to the next update branch to address your initial concern, so that will be brought on the WS addon soon™️.

I will see what is up with the r_flushlod thing before closing the issue.

thebigsleepjoe commented 7 months ago

Regarding r_flushlod, I believe I fixed it. I tried it a few times in various situations, and I think the patch I did a couple of days ago fixed it. Will push to Steam from v1.1 branch in a couple of days (when the branch is ready)

Ty for the report EntranceJew.