diff --git a/src/rts_player.cpp b/src/rts_player.cpp index 6d54c8c..ce6fca0 100644 --- a/src/rts_player.cpp +++ b/src/rts_player.cpp @@ -108,6 +108,7 @@ void RTSPlayer::order_activate_object_under_cursor() { marker->set_global_position(dict["position"]); this->selected_unit->begin_marker_temporary(marker); } + bool RTSPlayer::order_activate_object(gd::Node3D *node) { // get the hit object as a marker if(GoalMarker *marker = gd::Object::cast_to(node)) { @@ -119,7 +120,7 @@ bool RTSPlayer::order_activate_object(gd::Node3D *node) { this->selected_unit->set_target_goal(unit, goap::Goal::create("is_target_dead", true)); return true; } - return false; + return unit != nullptr; }