@@ -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