Skip to content

Commit

Permalink
Fix EventsFunctionsContainer copy constructor now copy the owner
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Jan 20, 2025
1 parent 60e36f3 commit 9f059e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Core/GDCore/Project/EventsFunctionsContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class GD_CORE_API EventsFunctionsContainer

EventsFunctionsContainer(FunctionOwner source_) : owner(source_) {}

EventsFunctionsContainer(const EventsFunctionsContainer &other) {
EventsFunctionsContainer(const EventsFunctionsContainer &other)
: owner(other.owner) {
Init(other);
}

Expand Down
2 changes: 2 additions & 0 deletions Core/tests/EventsFunctionsContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ TEST_CASE("EventsFunctionsContainer", "[common]") {
"Function2.x");
REQUIRE(eventsFunctionContainer.GetEventsFunction(2).GetName() ==
"Function3");
REQUIRE(eventsFunctionContainer.GetOwner() ==
gd::EventsFunctionsContainer::FunctionOwner::Extension);
REQUIRE(eventsFunctionContainer2.GetEventsFunctionsCount() == 3);
REQUIRE(eventsFunctionContainer2.GetEventsFunction(0).GetName() ==
"Function1.y");
Expand Down

0 comments on commit 9f059e2

Please sign in to comment.