45 years of coding experience helps.
Programming is more than following something somebody else wrote out. At heard, programming is providing a solution to a problem by breaking that problem down to it’s basic components.
In this case, it’s just going over what we know we need in psuedo code:
- If we have an aggrogroup, then we need to add the character to the aggrogroup
- If we have an aggrogroup and a DialogueAggro, then we need to add the character to the aggrogroup and add the aggrogroup to the DialogueAggro…
Then it’s just following the logic that since one of these conditions exists in both statements, then we can simplify the second statement
- If we have an aggrogroup, then we need to add the character to the aggrogroup
a) If we have a DialogueAggro, then we need to add the aggrogroup to the DialogueAggro…