Jump to content

Weird night vision crash when host of a caves server


BushmannGG1392
  • Fixed

For some reason (due to the recent Magician's Box change) when the host of a caves server gives themselves night vision via the playervision component in the console, trying to inspect things in the dark has the likely chance of crashing the server (only the server, mind you).

[00:02:15]: [string "scripts/components/inspectable.lua"]:55: attempt to index local 'owner' (a boolean value)
LUA ERROR stack traceback:
    scripts/components/inspectable.lua:55 in (method) GetDescription (Lua) <49-81>
    scripts/actions.lua:828 in (field) fn (Lua) <823-843>
    scripts/bufferedaction.lua:25 in (method) Do (Lua) <21-35>
    scripts/entityscript.lua:1436 in (method) PushBufferedAction (Lua) <1405-1448>
    scripts/components/locomotor.lua:701 in (method) PushAction (Lua) <669-750>
    scripts/components/playercontroller.lua:3526 in (method) DoAction (Lua) <3453-3530>
    scripts/components/playercontroller.lua:3733 in (method) OnRemoteLeftClick (Lua) <3687-3740>
    scripts/networkclientrpc.lua:79 in () ? (Lua) <57-85>
    =[C]:-1 in (method) CallRPC (C) <-1--1>
    scripts/networkclientrpc.lua:1238 in (global) HandleRPCQueue (Lua) <1219-1288>
    scripts/update.lua:42 in () ? (Lua) <33-135>

Steps to Reproduce

Host a caves server, give yourself night vision via console, then examine something in the dark

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Same issue

scripts/components/inspectable.lua (50-61)
if self.inst == viewer then
    return
elseif not CanEntitySeeTarget(viewer, self.inst) then
	local owner = self.inst.components.inventoryitem ~= nil and self.inst.components.inventoryitem.owner
	if not (owner ~= nil and
			owner:HasTag("pocketdimension_container") and
			owner.components.container ~= nil and
			owner.components.container:IsOpenedBy(viewer)
		) then
		return GetString(viewer, "DESCRIBE_TOODARK")
	end
end

it should be

if self.inst == viewer then
   return
elseif not CanEntitySeeTarget(viewer, self.inst) then
	local owner = self.inst.components.inventoryitem ~= nil and self.inst.components.inventoryitem.owner or nil
	if not (owner ~= nil and
			owner:HasTag("pocketdimension_container") and
			owner.components.container ~= nil and
			owner.components.container:IsOpenedBy(viewer)
		) then
		return GetString(viewer, "DESCRIBE_TOODARK")
	end
end

 

Edited by Flynn_
  • Like 2
  • Ninja 1

Share this comment


Link to comment
Share on other sites

20 minutes ago, Flynn_ said:

Same issue

scripts/components/inspectable.lua (50-61)

it should be

local owner = self.inst.components.inventoryitem ~= nil and self.inst.components.inventoryitem.owner or nil

 This is correct.

Changed Status to Fixed

  • Like 4
  • Thanks 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...