• Print

Author Topic: ULX Slay Command Crashes TTT Server  (Read 5219 times)

0 Members and 1 Guest are viewing this topic.

Offline Deathstrike

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
ULX Slay Command Crashes TTT Server
« on: June 25, 2015, 12:10:43 pm »
Hello, I have ULX admin mod installed on my server, and whenever I try to slay someone or myself, the server crashes and this is what shows up in console.log:

[ERROR] gamemodes/terrortown/gamemode/player.lua:685: Tried to use a NULL entity!
  1. Send - [C]:-1
   2. unknown - gamemodes/terrortown/gamemode/player.lua:685
    3. Kill - [C]:-1
     4. call - addons/ulx/lua/ulx/modules/sh/fun.lua:85
      5. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
       6. unknown - addons/ulib/lua/ulib/shared/commands.lua:1306
        7. pcall - [C]:-1
         8. pcallError - addons/ulib/lua/ulib/shared/util.lua:534
          9. fn - addons/ulib/lua/ulib/server/concommand.lua:67
           10. unknown - addons/ulib/lua/ulib/shared/hook.lua:179



[ERROR] gamemodes/terrortown/gamemode/player.lua:685: Tried to use a NULL entity!
  1. Send - [C]:-1
   2. unknown - gamemodes/terrortown/gamemode/player.lua:685
    3. Kill - [C]:-1
     4. call - addons/ulx/lua/ulx/modules/sh/fun.lua:85
      5. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
       6. unknown - addons/ulib/lua/ulib/shared/commands.lua:1306
        7. pcall - [C]:-1
         8. pcallError - addons/ulib/lua/ulib/shared/util.lua:534
          9. fn - addons/ulib/lua/ulib/server/concommand.lua:67
           10. unknown - addons/ulib/lua/ulib/shared/hook.lua:179

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: ULX Slay Command Crashes TTT Server
« Reply #1 on: June 25, 2015, 08:33:28 pm »
It looks like someone made a mistake in the code for the current version of TTT.  It will already be fixed on the next version of gmod.


The net send uses the ply variable, which doesn't exist.  If you really wanted to, you could probably go in and change it to victim as shown on github and it will just update normally later.  Your error is really long because of ULib's hook overwrite, so it includes all that in the stack trace.
(The code that is broken)
Code: Lua
  1. function GM:PlayerDeath( victim, infl, attacker)
  2.    -- tell no one
  3.    self:PlayerSilentDeath(victim)
  4.  
  5.    victim:SetTeam(TEAM_SPEC)
  6.    victim:Freeze(false)
  7.    victim:SetRagdollSpec(true)
  8.    victim:Spectate(OBS_MODE_IN_EYE)
  9.  
  10.    local rag_ent = victim.server_ragdoll or victim:GetRagdollEntity()
  11.    victim:SpectateEntity(rag_ent)
  12.  
  13.    victim:Flashlight(false)
  14.  
  15.    victim:Extinguish()
  16.  
  17.    net.Start("TTT_PlayerDied") net.Send(ply)  -- <<<<< THIS RIGHT HERE
  18.  
  19.    if HasteMode() and GetRoundState() == ROUND_ACTIVE then
  20.       IncRoundEnd(GetConVar("ttt_haste_minutes_per_death"):GetFloat() * 60)
  21.    end
  22. end

EDIT:  To my surprise, this bug is apparently a year old and hasn't been fixed until now.  I'm surprised we haven't seen more issues or reports.  I have never noticed it until now.

I'm not even sure if that will fix your crashing issue.
« Last Edit: June 25, 2015, 08:40:38 pm by Aaron113 »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Slay Command Crashes TTT Server
« Reply #2 on: June 26, 2015, 08:31:28 pm »
EDIT:  To my no surprise, this bug[/url].

There. Fixed that for you.
Also, Deathstrike, to be more clear on Aaron's mention and ULib being in your error, a majority of Lua errors with non-ULib related code will include our lines near the end.
The first 2-3 lines are almost always going to be the culprit root cause.
As Aaron points out, a bug in TTT.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: ULX Slay Command Crashes TTT Server
« Reply #3 on: June 28, 2015, 03:20:24 pm »
As Aaron points out, a bug in TTT.
But is that for sure the cause of the crash?  I doubt it is ULX or ULib, but it could possibly be something else.  I guess we will have to wait and see what the OP says.

  • Print