I’m making a Voting System for a project, but cannot seem to get past this roadblock. I’m using Instanced Structs as a value in a TMap, so I can easily extend the base struct with whatever voting requirements I need.
InVote.GetMutablePtr()->bVoteActive = true;
checkf(InVote.Get().bVoteActive, TEXT(“Vote not active”));VoteMap.Add(InConstituent, InVote);
OnVoteCast.Broadcast(InVote);checkf(VoteMap.FindRef(InConstituent).Get().bVoteActive, TEXT(“Vote not active”));
I want to be able to see if the vote is active (the player has voted) or not, but I’m very confused here. I’m setting the vote to be active, and the check is passing. So InVote is being set to active successfully. However the check on the last line is not passing.
I need this to work as it is the backbone of verifying if the Vote has been casted successfully for different configurations such as closing the poll once everyone has voted.
for(const auto& Pair : VoteMap)
{
const bool bIsVoteActive = Pair.Value.Get().bVoteActive;
if(!bIsVoteActive)
{
bAllVoted = false;
break;
}
}
Originally it was a Mutable struct, but that hasn’t worked either.
InVote.GetMutable()
Not really sure what else to attempt here, would really appreciate any more suggestions