Skip to content

Check isentity on owner in DrawWorldTip#3495

Merged
Astralcircle merged 1 commit intowiremod:masterfrom
bjurd:master
Feb 7, 2026
Merged

Check isentity on owner in DrawWorldTip#3495
Astralcircle merged 1 commit intowiremod:masterfrom
bjurd:master

Conversation

@bjurd
Copy link
Copy Markdown
Contributor

@bjurd bjurd commented Feb 7, 2026

Same as #3292

Was broke/undone by #3477

[Wiremod Canary] lua/includes/util.lua:263: attempt to index local 'object' (a number value)
  1. IsValid - lua/includes/util.lua:263
   2. DrawWorldTip - lua/entities/base_wire_entity.lua:162
    3. unknown - lua/entities/base_wire_entity.lua:227
     4. unknown - addons/libbys_optimizers/lua/includes/modules/hook.lua:313 (x6)

@Astralcircle
Copy link
Copy Markdown
Contributor

Astralcircle commented Feb 7, 2026

E2Lib also uses the regular IsValid for this. Does PatchProtect only return CPPI.CPPI_DEFER on the client?
image

@bjurd
Copy link
Copy Markdown
Contributor Author

bjurd commented Feb 7, 2026

It only defers for client

function sh_PProtect.GetOwner(ent)
	if CLIENT and ent.ppowner == nil then
		net.Start("pprotect_request_cl_data")
			net.WriteString("owner")
			net.WriteEntity(ent)
		net.SendToServer()
		ent.ppowner = "wait"
		return "wait"
	end
	if CLIENT and ent.ppowner == "world" then return nil end
	return ent.ppowner
end
function ENTITY:CPPIGetOwner()
	local ply = sh_PProtect.GetOwner(self)
	if ply == nil then return nil, nil end
	if ply == "wait" then return CPPI.CPPI_DEFER, CPPI.CPPI_DEFER end
	return ply, CPPI.CPPI_NOTIMPLEMENTED
end

@Astralcircle
Copy link
Copy Markdown
Contributor

Fine then

@Astralcircle Astralcircle merged commit 79192aa into wiremod:master Feb 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants