Skip to content

Commit

Permalink
The constructor is not from a C-String, is from a Godot String, so de…
Browse files Browse the repository at this point in the history
…al with that
  • Loading branch information
migueldeicaza committed May 21, 2023
1 parent 5d82098 commit 20859a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/SwiftGodot/Variant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ public class Variant: Hashable, Equatable, ExpressibleByStringLiteral {

public required init(stringLiteral: String) {
var vh: UnsafeMutableRawPointer?
var v = GDExtensionStringPtr (mutating: stringLiteral.cString(using: .utf8))
Variant.fromTypeMap [GType.string.rawValue] (&content, &v)
var gstring = GString (stringLiteral: stringLiteral)

Variant.fromTypeMap [GType.string.rawValue] (&content, &gstring.content)
}

public init (_ value: Float) {
Expand Down

0 comments on commit 20859a7

Please sign in to comment.