Skip to content

Commit

Permalink
Throw error if holo index is NaN (#3135)
Browse files Browse the repository at this point in the history
* Save wiremod holograms from NaN indexes
  • Loading branch information
Zvbhrf authored Sep 9, 2024
1 parent 5c5f3dd commit a47523b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_expression2/core/hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ 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 function CheckIndex(self, index, shouldbenil)
if index ~= index then return self:throw("holo index is NaN!", nil) end
index = math.Clamp(math.floor(index), -2^31, 2^31)
local Holo
if index<0 then
Expand Down

0 comments on commit a47523b

Please sign in to comment.