Skip to content

ConvertCard clamps field 'card' instead of parameter 'cards' #11

Description

@torbjorn

In Monopoly/NetworkAdapter.cs:

public float ConvertCard(int cards)
{
    float clamp = Math.Clamp(card, 0.0f, 1.0f);   // 'card' is the offset field (12), not the parameter
    return clamp;
}

Math.Clamp(12, ...) is always 1.0f, so the jail-card inputs are stuck at 1.0 once set — the networks never see actual card holdings.

Fix:

float clamp = Math.Clamp((float)cards, 0.0f, 1.0f);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions