calmackenzie / VG1819

Final Project for CS4830 2018 - 2019
0 stars 2 forks source link

Control mode showed wrong defeat/victory #469

Closed calmackenzie closed 5 years ago

calmackenzie commented 5 years ago

Host (yellow) lost even though he was the one gaining points image

SRJYC commented 5 years ago

`
networking::ClientGame* client = networking::ClientGame::getInstance();

            if (clientId == client->getClientId())
    {
        eventData->putInt(GAME_END_RESULT, HOST_COMMANDER_DIED);
    }

    else
    {
        eventData->putInt(GAME_END_RESULT, CLIENT_COMMANDER_DIED);
    }`

These lines in GameModeManager check the which one wins. I think this where the problem is.

clientId is the id for winner.

@kamarapala. I assumed HOST_COMMANDER_DIED means victory and CLIENT_COMMANDER_DIED means defeated. Was I wrong?

kamarapala commented 5 years ago

I think I set it up a bit weird since when I implemented the original Commander death victory condition, it checked the ID of the Commander that died to this client's ID. So it was checking the ID of the losing player.

With the new game mode conditions, it's checking this client's ID against the ID of the winning player. That's why they are reversed.

The macro names should also probably be changed at this point since they aren't accurate to what's actually happening

SRJYC commented 5 years ago

OK, I will change Host die to DEFEAT and client die to VICTORY