Skip to content

Mood update overflow #484

@rnyoakum

Description

@rnyoakum

When astronaut/cosmonaut mood is updated in start.cpp, the 'naut's mood is directly modified, with all modifiers being applied to their mood before it is eventually limited to the [0,100] range. If the mood variable wasn't an 8-bit value, this wouldn't be a problem - but mood is stored in an 8-bit variable. While 8 bits can safely hold the [0, 100] range of legal moods, it can't hold the pre-limited temporary values.

Consequently, a happy astronaut going on a successful mission can find their mood value wrapping over into negative numbers, leading to two entire flight crews resigning from sudden bitterness during their moment of triumph. Sigh.

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