Skip to content

Conversation

@Denneisk
Copy link
Member

@Denneisk Denneisk commented Oct 5, 2023

Allows E2 constraintcore to constraint to the world entity despite ownership.


local function checkEnts(self, ent1, ent2)

if not (ent1 and ent2) then return self:throw("Invalid entity (nil)!", false) end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (nil) isn't necessary, E2 users won't know what that is so it'll just confuse them.

I think not ent1 or not ent2 would also be more clear logic

if not (ent1 and ent2) then return self:throw("Invalid entity (nil)!", false) end

if not ent1:IsWorld() then
if not IsValid(ent1) then return self:throw("Invalid entity!", false) end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can change this to ent1:IsValid() since you added the nil check at the top

@vurvdev vurvdev merged commit e824652 into wiremod:master Oct 6, 2023
@Denneisk Denneisk deleted the nocollide-world branch November 16, 2023 22:29
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