Skip to content

Commit

Permalink
For prop.createSent(): check if frozen is a boolean (#1838)
Browse files Browse the repository at this point in the history
* For prop.createSent(): check if frozen is a boolean

I forgot to specify `frozen` in one of my SF projects and my `data` ended up in its place, yet I received no error and it wasn't until I spent 1 second of my life to double-check docs when I fixed my problem. I highly doubt anyone is going to get any problems with me adding one extra check that 99% of good starfalls won't crash from.

* Update lua/starfall/libs_sv/prop.lua

Co-authored-by: thegrb93 <[email protected]>

* Update prop.lua

* Update prop.lua
  • Loading branch information
SuperTemich2005 authored Aug 25, 2024
1 parent d1bb96d commit 0949b29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/starfall/libs_sv/prop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,15 @@ end
-- @param Vector pos Position of created sent
-- @param Angle ang Angle of created sent
-- @param string class Class of created sent
-- @param boolean frozen True to spawn frozen
-- @param boolean? frozen True to spawn frozen (default false)
-- @param table? data Optional table, additional entity data to be supplied to certain SENTs. See prop.SENT_Data_Structures table in Docs for list of SENTs
-- @server
-- @return Entity The sent object
function props_library.createSent(pos, ang, class, frozen, data)
checkpermission(instance, nil, "prop.create")

checkluatype(class, TYPE_STRING)
frozen = frozen and true or false
if frozen~=nil then checkluatype(frozen, TYPE_BOOL) else frozen = false end

local pos = SF.clampPos(vunwrap(pos))
local ang = aunwrap(ang)
Expand Down

0 comments on commit 0949b29

Please sign in to comment.