From 54af717df87b98283d1cca2ec27689f1b5de38ef Mon Sep 17 00:00:00 2001 From: Josh Perry Date: Tue, 13 Mar 2018 14:30:25 +0000 Subject: [PATCH] Fix for Entity:has not returning false if the component doesn't exist The documentation states that Entity:has will return false if the component doesn't exist and true if it does. However, the previous behaviour was to return nil if the component doesn't exist. --- fluid/entity.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluid/entity.lua b/fluid/entity.lua index 451e0e5..944dc30 100644 --- a/fluid/entity.lua +++ b/fluid/entity.lua @@ -71,7 +71,7 @@ end -- @params component The Component to check against -- @return True if the entity has the Bag. False otherwise function Entity:has(component) - return self.components[component] and true + return self.components[component] ~= nil end return setmetatable(Entity, {