File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,24 @@ macro_rules! godot_nativescript_init {
35
35
return ;
36
36
}
37
37
38
+ // Compatibility warning if using in-house Godot version (not applicable for custom ones)
39
+ #[ cfg( not( feature = "custom-godot" ) ) ]
40
+ {
41
+ let engine = gdnative:: api:: Engine :: godot_singleton( ) ;
42
+ let info = engine. get_version_info( ) ;
43
+
44
+ if info. get( "major" ) . expect( "major version" ) != Variant :: new( 3 )
45
+ || info. get( "minor" ) . expect( "minor version" ) != Variant :: new( 4 ) {
46
+ let string = info. get( "string" ) . expect( "version str" ) . to:: <String >( ) . expect( "version str type" ) ;
47
+ gdnative:: log:: godot_warn!(
48
+ "This godot-rust version is only compatible with Godot 3.4.x; detected version {}.\n \
49
+ GDNative mismatches may lead to subtle bugs, undefined behavior or crashes at runtime.\n \
50
+ Apply the 'custom-godot' feature if you want to use current godot-rust with another Godot engine version.",
51
+ string
52
+ ) ;
53
+ }
54
+ }
55
+
38
56
let __result = :: std:: panic:: catch_unwind( || {
39
57
$callback( $crate:: init:: InitHandle :: new( handle) ) ;
40
58
} ) ;
You can’t perform that action at this time.
0 commit comments