Skip to content

Commit

Permalink
various minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ParadoxV5 committed Oct 8, 2023
1 parent 2090ca2 commit 99fa429
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/godot_rb.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern GDExtensionClassLibraryPtr godot_rb_library;

/** @deprecated Members shall be moved to file-private globals instead. */
extern struct godot_rb_gdextension {
//TODO: Categorize
GDExtensionInterfacePrintErrorWithMessage print_error_with_message;
GDExtensionInterfacePrintScriptErrorWithMessage print_script_error_with_message;
GDExtensionInterfaceMemAlloc mem_alloc;
Expand Down Expand Up @@ -117,7 +116,7 @@ void godot_rb_variant_call(godot_rb_variant_call_function function, VALUE self,
extern rb_encoding* godot_rb_encoding_UTF32;

#define godot_rb_error(message) \
godot_rb_gdextension.print_error_with_message (message, message, __func__, __FILE__, __LINE__, false)
godot_rb_gdextension.print_error_with_message(message, message, __func__, __FILE__, __LINE__, false)
/** `begin`–`rescue`s the passed function.
If an exception occurs, log a Script Error or, for non-{rb_eStandardError}s, a generic Error;
also ping the Godot Engine Editor if exception backtrace is available
Expand Down
2 changes: 1 addition & 1 deletion lib/godot/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def method_missing(name, *args)
name.to_s,
args,
receiver: self
) if name.start_with? '_'
) unless %w[has_singleton class_exists get_parent_class set_script register_script_language].include? name.to_s
super
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/godot/ruby_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def _is_valid = !!klass
alias _can_instantiate _is_valid
def _instance_has(obj) = klass ? obj.instance_of?(klass) : false

# TODO: what are its other purpose – besides convenience – if every reflection includes inheritance?
def _get_base_script
klass.superclass.const_get :RUBY_SCRIPT if klass
end
Expand Down
1 change: 1 addition & 0 deletions lib/godot/variant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def method_missing(name, *args)
end

alias _init initialize
public :_init
alias == eql?
def to_godot = self
end
Expand Down

0 comments on commit 99fa429

Please sign in to comment.