Skip to content

Commit

Permalink
Try #954:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] committed Oct 2, 2022
2 parents 8ed2e11 + 213d801 commit e142dee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gdnative-core/src/init/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ macro_rules! godot_nativescript_init {
// Compatibility warning if using in-house Godot version (not applicable for custom ones)
#[cfg(not(feature = "custom-godot"))]
{
let engine = gdnative::api::Engine::godot_singleton();
use $crate::core_types::Variant;

let engine = $crate::api::Engine::godot_singleton();
let info = engine.get_version_info();

if info.get("major").expect("major version") != Variant::new(3)
|| info.get("minor").expect("minor version") != Variant::new(5)
|| info.get("patch").expect("patch version") < Variant::new(1) {
let string = info.get("string").expect("version str").to::<String>().expect("version str type");
gdnative::log::godot_warn!(
$crate::log::godot_warn!(
"This godot-rust version is only compatible with Godot >= 3.5.1 and < 3.6; detected version {}.\n\
GDNative mismatches may lead to subtle bugs, undefined behavior or crashes at runtime.\n\
Apply the 'custom-godot' feature if you want to use current godot-rust with another Godot engine version.",
Expand Down

0 comments on commit e142dee

Please sign in to comment.