Skip to content

This is just tell how to fix vector crash problem #4

Description

@mindoff6502

Since this project seems dead and many people may be interested.

I fix this vector crash on Visual Studio myself and share it right now.

It is all due to the wrong convertion from

2d-engine\Platformer\tile.h

search function named

void update()

you will see

currentAtlasFrame = static_cast(looped ? 0 : frames.size()) - 1;

This is wrong,should be

currentAtlasFrame = static_cast(looped ? 0 : frames.size() - 1);

Another vector crash occured when you holding a shell run and jump cancel another shell.

This is an animations frame out of boundry problem from

2d-engine\Platformer\entity.cpp

search

AnimationFrame* Entity::getFrame()

replace

return &frames->animations[animationState][currentAnimationFrame];

with

return &frames->animations[animationState][currentAnimationFrame % (frames->animations[animationState].size())];

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