Skip to content

Wrong size returned by Struct.GetStructSize on some structs #210

@rashandan

Description

@rashandan

In example:
struct Bridge { public float float1; public bool bool1; public bool bool2; public bool bool3; public bool bool4; }
size of above structure must be 5, but when reading by ReadStruct, it spawns exeption.
Inside this function, call to Struct.GetStructSize returns 4.
I believe there must be something like return (int)Math.Ceiling(numBytes); instead of return (int)numBytes;
This happens when struct ends by from 1 to 7 bool-s.

//sorry for my English

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