Skip to content

Commit fd918b3

Browse files
authored
Passed review PR (#3650)
* fix: apply passed review fixes * fix: drop MakeWireEnt guard
1 parent a645ca4 commit fd918b3

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

addon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"git-hooks-pre-commit",
1616
"gitrid.sh",
1717
"LICENSE",
18-
"wiremod.*"
18+
"wiremod.*",
1919
"benchmark_*"
2020
]
2121
}

lua/entities/gmod_wire_customprop/shared.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ return {
5858
classname = "gmod_wire_customprop",
5959

6060
readReliableEntity = function(callback)
61-
index = net.ReadUInt(16)
62-
creationIndex = net.ReadUInt(32)
61+
local index = net.ReadUInt(16)
62+
local creationIndex = net.ReadUInt(32)
6363
local startTime = CurTime()
6464

6565
local function check()

lua/wire/server/sents_registry.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,8 @@ register("gmod_wire_value", {
11371137
VECTOR2 = function(val, e2TypeID)
11381138
if e2TypeID == TYPE_TABLE and #val >= 2 and isnumber(val[1]) and isnumber(val[2]) then return val[1]..", "..val[2] end
11391139
if e2TypeID == TYPE_STRING then
1140-
local x,y,z = string.match( val, "^ *([^%s,]+) *, *([^%s,]+) *$" )
1141-
if x and y and z then return x..", "..y..", "..z end
1140+
local x,y = string.match( val, "^ *([^%s,]+) *, *([^%s,]+) *$" )
1141+
if x and y then return x..", "..y end
11421142
end
11431143

11441144
return nil
@@ -1201,7 +1201,7 @@ register("gmod_wire_value", {
12011201
elseif e2TypeID == TYPE_VECTOR then val = {"VECTOR", castE2TypeToWireValueType["VECTOR"](val, e2TypeID)}
12021202
elseif e2TypeID == TYPE_ANGLE then val = {"ANGLE", castE2TypeToWireValueType["ANGLE"](val, e2TypeID)}
12031203
elseif e2TypeID == TYPE_STRING then val = {"STRING", castE2TypeToWireValueType["STRING"](val, e2TypeID)}
1204-
else return "Incorrect 'value' parameter #"..i.." type! Expected table (Ex. table(\"normal\", 0)). Got: "..type( steamid ) end
1204+
else return "Incorrect 'value' parameter #"..i.." type! Expected table (Ex. table(\"normal\", 0)). Got: "..type( val ) end
12051205
elseif not isnumber(val[1]) then -- Plain table
12061206
if TypeID(val[1]) ~= TYPE_STRING then return "Incorrect 'value' parameter #"..i.."[1] type! Expected string ('NORMAL/VECTOR/VECTOR2/VECTOR4/ANGLE/STRING'). Got: "..type( val ) end
12071207

@@ -1214,15 +1214,15 @@ register("gmod_wire_value", {
12141214
end
12151215
val = {wireValueType, CastFunc(val[2], TypeID(val[2]))}
12161216
elseif #val == 2 then -- vector2
1217-
local tempVal = castE2TypeToWireValueType["VECTOR2"](val[2], typeID(val[2]))
1217+
local tempVal = castE2TypeToWireValueType["VECTOR2"](val, TypeID(val))
12181218
if not tempVal then
12191219
return "Incorrect 'value' parameter #"..i.." value! Expected 'VECTOR2'. Got: "..tostring(val[2])
12201220
end
12211221

12221222
val = {"VECTOR2", tempVal}
12231223
elseif #val==4 then -- vector4
1224-
local tempVal = castE2TypeToWireValueType["VECTOR4"](val[2], typeID(val[2]))
1225-
if not tempVal then return "Incorrect 'value' parameter #"..i.." value! Expected 'VECTOR2'. Got: "..tostring(val[2]) end
1224+
local tempVal = castE2TypeToWireValueType["VECTOR4"](val, TypeID(val))
1225+
if not tempVal then return "Incorrect 'value' parameter #"..i.." value! Expected 'VECTOR4'. Got: "..tostring(val[2]) end
12261226

12271227
val = {"VECTOR4", tempVal}
12281228
else

0 commit comments

Comments
 (0)