diff options
author | Nickolai Korshunov <n.a.korshunov@gmail.com> | 2018-04-25 11:40:49 +0300 |
---|---|---|
committer | Nickolai Korshunov <n.a.korshunov@gmail.com> | 2018-04-25 11:40:49 +0300 |
commit | ef37d8d76e45a8249f34e66dfcc80954fecd5981 (patch) | |
tree | 2c155a6f9107b21474e9f1adcb0d4b752bb2e7bc /src/core/NodePath.cpp | |
parent | 876715b610a52749e5cc7824122f892dd430ffab (diff) | |
parent | 68ba815bc5c9ffa9494511f9feb8ea36a95369d7 (diff) | |
download | redot-cpp-ef37d8d76e45a8249f34e66dfcc80954fecd5981.tar.gz |
Merge branch 'master' of https://github.com/GodotNativeTools/godot-cpp
Diffstat (limited to 'src/core/NodePath.cpp')
-rw-r--r-- | src/core/NodePath.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/NodePath.cpp b/src/core/NodePath.cpp index 25ce882..b1fb9cc 100644 --- a/src/core/NodePath.cpp +++ b/src/core/NodePath.cpp @@ -17,7 +17,6 @@ NodePath::NodePath(const NodePath &other) { String from = other; godot::api->godot_node_path_new(&_node_path, (godot_string *) &from); - godot::api->godot_node_path_operator_equal(&_node_path, &other._node_path); } NodePath::NodePath(const String &from) @@ -71,9 +70,18 @@ NodePath::operator String() const return *(String *) &str; } +bool NodePath::operator ==(const NodePath& other) +{ + return godot::api->godot_node_path_operator_equal(&_node_path, &other._node_path); +} + void NodePath::operator =(const NodePath& other) { - godot::api->godot_node_path_operator_equal(&_node_path, &other._node_path); + godot::api->godot_node_path_destroy(&_node_path); + + String other_string = (String) other; + + godot::api->godot_node_path_new(&_node_path, (godot_string *) &other_string); } NodePath::~NodePath() |