Skip to content

Commit

Permalink
Just throw an error... nothing more
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvbhrf committed Sep 6, 2024
1 parent 6862b58 commit 6037508
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/entities/gmod_wire_expression2/core/hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,10 @@ end

-- Returns the hologram with the given index or nil if it doesn't exist.
-- if shouldbenil is nil or false, assert that the hologram exists on @strict with an error. Otherwise, don't check (for holo creation, etc)
local MAX_INDEX = 2 ^ 31
local function CheckIndex(self, index, shouldbenil)
index = math.Clamp(math.floor(index), -2^31, 2^31)
if index ~= index then return self:throw("holo index is NaN!", 0) end
index = math.Clamp(math.floor(index), -MAX_INDEX, MAX_INDEX)
local Holo
if index<0 then
Holo = E2HoloRepo[self.uid][-index]
Expand Down

0 comments on commit 6037508

Please sign in to comment.