fix: linter
This commit is contained in:
+1
-16
@@ -701,21 +701,6 @@ func luaDefaultValue(f parser.Field, enumNames map[string]struct{}) string {
|
|||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
|
||||||
func luaTypeName(f parser.Field, enumNames map[string]struct{}) string {
|
|
||||||
switch f.Kind {
|
|
||||||
case parser.KindPrimitive:
|
|
||||||
if luaIsEnumType(f, enumNames) {
|
|
||||||
return "number"
|
|
||||||
}
|
|
||||||
return "number"
|
|
||||||
case parser.KindNested:
|
|
||||||
return f.TypeName
|
|
||||||
case parser.KindFixedArray, parser.KindSlice:
|
|
||||||
return "table"
|
|
||||||
}
|
|
||||||
return "any"
|
|
||||||
}
|
|
||||||
|
|
||||||
func luaSerializeValueExpr(access string, f parser.Field, enumNames map[string]struct{}) string {
|
func luaSerializeValueExpr(access string, f parser.Field, enumNames map[string]struct{}) string {
|
||||||
if !luaIsEnumType(f, enumNames) {
|
if !luaIsEnumType(f, enumNames) {
|
||||||
return access
|
return access
|
||||||
@@ -765,7 +750,7 @@ func checkFieldLuaSupport(msgName string, f parser.Field) error {
|
|||||||
switch f.Kind {
|
switch f.Kind {
|
||||||
case parser.KindPrimitive:
|
case parser.KindPrimitive:
|
||||||
if f.Primitive == parser.KindInt64 || f.Primitive == parser.KindUint64 {
|
if f.Primitive == parser.KindInt64 || f.Primitive == parser.KindUint64 {
|
||||||
return fmt.Errorf("Lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName)
|
return fmt.Errorf("lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName)
|
||||||
}
|
}
|
||||||
case parser.KindFixedArray, parser.KindSlice:
|
case parser.KindFixedArray, parser.KindSlice:
|
||||||
if f.Elem != nil {
|
if f.Elem != nil {
|
||||||
|
|||||||
Vendored
+4
-4
@@ -19,10 +19,10 @@ type MoveMessage struct {
|
|||||||
Velocity [3]float32
|
Velocity [3]float32
|
||||||
Waypoints []Vector3
|
Waypoints []Vector3
|
||||||
PlayerID uint32
|
PlayerID uint32
|
||||||
Active bool
|
Active bool
|
||||||
Visible bool
|
Visible bool
|
||||||
Ghost bool
|
Ghost bool
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SpawnMessage struct {
|
type SpawnMessage struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user