Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code formatting bug with enum structs #446

Open
Earendil-89 opened this issue Jan 25, 2025 · 0 comments
Open

Code formatting bug with enum structs #446

Earendil-89 opened this issue Jan 25, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Earendil-89
Copy link

Basic informations

  • OS: [Windows]
  • VSCode version: Latest
  • Extension version: Latest

Further Information

If I create an enum struct, after applying the formatter, the indentation breaks apart and brackets are placed incorrectly.
Before formatting:

enum struct SpawnPoint
{
    float pos[3];        // Orientative position in the world
    int spawnFlags;    // Flags to define the spawn properties
    Address navArea;       // Nav area attached to use to spawn

    bool Spawn(const float pos[3], spawnFlags)
    {
        this.pos = pos;
        this.spawnFlags = spawnFlags;
        if (!this.GetNavArea())
        {
            this.pos = NULL_VECTOR;
            this.spawnFlags = 0;
            return false;
        }
        return true;
    }
    bool GetNavArea()
    {
        this.navArea = L4D_GetNearestNavArea(this.pos);
        return this.navArea != Address_Null;
    }
}

After formatting


enum struct SpawnPoint
{
    float   pos[3];        // Orientative position in the world
    int     spawnFlags;    // Flags to define the spawn properties
    Address navArea;       // Nav area attached to use to spawn

    bool    Spawn(const float pos[3], spawnFlags){
        this.pos        = pos;
        this.spawnFlags = spawnFlags;
        if (!this.GetNavArea()){
            this.pos        = NULL_VECTOR;
            this.spawnFlags = 0;
            return false; }
return true;
}
bool GetNavArea()
{
    this.navArea = L4D_GetNearestNavArea(this.pos);
    return this.navArea != Address_Null;
}
}
@Earendil-89 Earendil-89 added the bug Something isn't working label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants