Skip to content

Commit

Permalink
Slightly cleaner.
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Dec 5, 2024
1 parent 40fbdca commit 4f4776f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftGodot/Core/GenericSignal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ extension Arguments {

// try to unpack the variant as the expected type
let value: T?
if (argument.gtype == .object) && (T.Representable.godotType == .object) {
value = argument.asObject(T.self as! Object.Type) as? T
if let objectType = type as? Object.Type, (argument.gtype == .object) && (T.Representable.godotType == .object) {
value = argument.asObject(objectType) as? T
} else {
value = T(argument)
}
Expand Down

0 comments on commit 4f4776f

Please sign in to comment.