File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/dart/godot_dart_build/lib/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,10 @@ class GodotScriptAnnotationGenerator
330
330
for (final method in rpcMethods) {
331
331
var methodSignature = method.getDisplayString (withNullability: true );
332
332
String withIdParam;
333
- if (method.parameters.where ((p) => p.isNamed).isNotEmpty) {
333
+ if (method.parameters.isEmpty) {
334
+ withIdParam =
335
+ '${methodSignature .substring (0 , methodSignature .length - 1 )}{int? peerId})' ;
336
+ } else if (method.parameters.where ((p) => p.isNamed).isNotEmpty) {
334
337
withIdParam =
335
338
'${methodSignature .substring (0 , methodSignature .length - 2 )}, int? peerId})' ;
336
339
} else {
@@ -339,7 +342,7 @@ class GodotScriptAnnotationGenerator
339
342
}
340
343
buffer.write (withIdParam);
341
344
buffer.writeln ('{' );
342
- buffer.writeln (' final args = [' );
345
+ buffer.writeln (' final args = <Variant> [' );
343
346
for (final arg in method.parameters) {
344
347
buffer.write ('Variant(${arg .name }),' );
345
348
}
You can’t perform that action at this time.
0 commit comments