Skip to content

AstroTurn comments don't match code #428

@rnyoakum

Description

@rnyoakum

In the astronaut update code, there's a difference between some of the code comments and the game code. After a catastrophic failure, the astronauts in the program must test to see if they get scared and retire:

if (num > temp && cnt < (ActTotal[j] * .4)) {
    /* Guy retires due to being scared */
    if (j == 0) {
        Data->P[j].Pool[i].RetirementDelay = 3;  /* US Guy Retires in 2 */
        Data->P[j].Pool[i].Special = 1;
    }

    if (j == 1) {
        Data->P[j].Pool[i].RetirementDelay = 2;  /* URS Guy Retires Now */
        Data->P[j].Pool[i].Special = 1;
    }

    Data->P[j].Pool[i].RetirementReason = 11;    /* Reason=Scared */
}

For cosmonauts, the comment suggests they retires immediately, while the code has the cosmonaut retiring after the next turn. There are other USA/Soviet retirement differences for various retirement causes, but they don't follow a consistent pattern, so I'm not sure which is intended: the comment or the code.

Even more importantly, there's another comment/code disagreement when checking if astronaut/cosmonauts are mustering out:

/* Mustering Out - even seasons after 8 */
if ((Data->P[j].Pool[i].Active >= 8)
    && Data->P[j].Pool[i].Status == AST_ST_ACTIVE
    && Data->P[j].Pool[i].RetirementDelay == 0) {
        num = brandom(100);

        if (num > 89) {
            /* Guy retires */

In this case, the comment suggests astronauts / cosmonauts are tested for retirement every other season, but the code tests for retirement each season.

@peyre - Since you're the most authoritative source on gameplay, I was hoping you could issue a ruling on these items. Are they bugs or are the comments wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAn issue that causes a crash or an invalid or undesirable game state.

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions