Hug Support for Vanilla Chars

[Open Assets] Hug Support for Vanilla Chars Beta-V1.2

This content may be freely modified and/or maintained by anyone.
just fyi, the script raises this lua warning when someone becomes spectator:

Code:
WARNING: ...portForVanillaChars-Beta-v1.2.pk3|Lua/LUA_ALLHUG.lua:252: attempt to index field 'mo' (a nil value)
stack traceback:
    ...portForVanillaChars-Beta-v1.2.pk3|Lua/LUA_ALLHUG.lua:252: in function <...portForVanillaChars-Beta-v1.2.pk3|Lua/LUA_ALLHUG.lua:228>

this happens because player.mo is nil on a spectator, so you need to handle that case. the easiest way to handle this ime is just to check if this on the first line of the function in question and just return if it's nil, for example:

Code:
local function DoAThing(player)
  if not player.mo then
    return
  end
  -- other stuff
end
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top