Not sure (this thread starts to confuse me a little)
Yes, I'm sorry. This really has ended up in a totally different place.
I wouldn't be surprised if my initial issue had been a glitch, though. Sometimes I have things happen only once that can't be reproduced, and I'm thinking it might even be my hard drive or my RAM failing. For example, there was this one time in which I was testing my game, and clicking on an object was supposed to make the character walk up to it (blocking), and then start a dialogue. It had worked perfectly the 3572350 times I'd tested it before, but on this occasion the walking was skipped, and the dialogue was triggered immediately, as if the walk command had been set to noblock. I closed the game, ran it again, did the exact same thing, but I was never able to reproduce the issue. So go figure.
but maybe there's a misunderstanding of what "player" is? Just in case, "player" is not a special value that will automatically switch the variable to player all the time, it is a Character* pointer that directs to current player.
In above code you set targetCharacter to current player character, and then switch player control to another character. But targetCharacter will stay the same. This is why both characters end up in the room (module teleports targetCharacter to where current player is located).
Mind. Blown.
Thank you, CW. I had no idea this was how it worked. Now it makes total sense.
Or change the order of operations:
cTestCharacter.SetAsPlayer();
targetCharacter = player;
so you assign new player, and then assign new player to targetCharacter.
Would this work, though? Wouldn't the room change from setting cTestCharacter as player be effective immediately, thus keeping the next line from running?