From 6243967f1fac3af8ed3e72790cabed0f79978bdb Mon Sep 17 00:00:00 2001 From: fusion32 Date: Tue, 1 Jul 2025 07:21:10 -0300 Subject: fix `operator=` for `TChannel`, `TParty`, and `THouse` I had focused on copying the `vector` fields for theses structs but, being the copy operator, you need to copy everything over. --- src/operate.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/operate.cc') diff --git a/src/operate.cc b/src/operate.cc index a9644c2..7099cc1 100644 --- a/src/operate.cc +++ b/src/operate.cc @@ -3357,6 +3357,9 @@ TChannel::TChannel(const TChannel &Other) : TChannel() { } void TChannel::operator=(const TChannel &Other){ + this->Moderator = Other.Moderator; + memcpy(this->ModeratorName, Other.ModeratorName, sizeof(this->ModeratorName)); + this->Subscribers = Other.Subscribers; for(int i = 0; i < Other.Subscribers; i += 1){ *this->Subscriber.at(i) = Other.Subscriber.copyAt(i); @@ -3814,6 +3817,8 @@ TParty::TParty(const TParty &Other) : TParty() { } void TParty::operator=(const TParty &Other){ + this->Leader = Other.Leader; + this->Members = Other.Members; for(int i = 0; i < Other.Members; i += 1){ *this->Member.at(i) = Other.Member.copyAt(i); -- cgit v1.2.3