Skip to content

Reconsider float to integer rounding for map center coordinates #56

@Caball009

Description

@Caball009

roundedCenter = (int)((*CL_GetMapCenter())[index] + 0.5);

roundedCenter = (int)((*CL_GetMapCenter())[2] + 0.5);

roundedCentera = (svsHeader.mapCenter[indexa] + 0.5);

roundedCenter = (svsHeader.mapCenter[index] + 0.5);

roundedCentera = (svsHeader.mapCenter[2] + 0.5);

roundedCenter = (svsHeader.mapCenter[2] + 0.5);

As far as I can tell, the above code is the same as in the v1.7 pc executable.

It's an unfortunate way of rounding, though; e.g. -1.49f gets rounded to 0. I'd suggest using either std::round or just float to integer conversion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions