There is 1 Actor class called "TalkMenu" and another called "Survivor". A survivor actor creates new TalkMenu's, and passes itself into the TalkMenu constructor in doing so, so the TalkMenu can reference the Survivor that was used to create it. I want it so that when the TalkMenu is removed from the game, a boolean belonging to the Survivor that was used to create the TalkMenu is set to true. However, in my code the TalkMenu sets that boolean to true for ALL of the Survivor actors in the game, and not just the one used to create it.
Relevant survivor code:
Relevant TalkMenu code:
finishedDialogue then returns true for all instances of the Survivor class.
public Survivor(Controller c){
survivorNo = survivor;
controller = c;
}
private void initiateDialogue(){
getWorld().addObject(talkMenu = new TalkMenu(controller, this), 480, 420);
} public TalkMenu(Controller c, Survivor s){
controller = c;
survivor = s;
}
if(talk menu is being removed){
survivor.finishedDialogue = true;
getWorld().removeObject(this);
}
