summaryrefslogtreecommitdiffstats
path: root/src/core/NodePath.cpp
diff options
context:
space:
mode:
authorkarroffel <therzog@mail.de>2018-03-02 19:04:57 +0100
committerkarroffel <therzog@mail.de>2018-03-02 19:04:57 +0100
commit2343a8a54c13c2ccc617ed6716419dd568bb997f (patch)
tree78610cdf522020525979682ac227f40a7a87c70b /src/core/NodePath.cpp
parenta212746a3d249929eff1c4ca2fee4a2186ccf794 (diff)
downloadredot-cpp-2343a8a54c13c2ccc617ed6716419dd568bb997f.tar.gz
fix #101
Diffstat (limited to 'src/core/NodePath.cpp')
-rw-r--r--src/core/NodePath.cpp12
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()