femloy / OpenTower

A Pizza Tower decompilation.
https://discord.gg/thenoise
Creative Commons Zero v1.0 Universal
38 stars 14 forks source link

Crash as Knight Peppino #20

Closed burnedpopcorn closed 1 month ago

burnedpopcorn commented 1 month ago

Saw that you updated this repo recently, but I'm not sure if you fixed this in that update

I am using the 2022 LTS (like you recommended) and I have compiled it to GX.GAMES (to make it playable in the browser), and I noticed that in PizzaScape, it crashes when Knight Peppino slams into a wall when sliding.

This does not seem to be a GX.GAMES only issue, because of missing parathesis in scr_player_knightpepslopes

The problematic code line is Line 77 (image_index = [ ] )

Example of UNpatched code that crashes

        if ispeppino
        {
            instance_create(x + (xscale * 40), y, obj_bumpeffect);
            movespeed = 0;
            vsp = -6;
            sprite_index = spr_knightpepbump;
            image_index = floorimage_number - 1;
            state = states.knightpepbump;
            fmod_event_one_shot_3d("event:/sfx/pep/groundpound", x, y);
        }

Example of PATCHED code that does not crash

        if ispeppino
        {
            instance_create(x + (xscale * 40), y, obj_bumpeffect);
            movespeed = 0;
            vsp = -6;
            sprite_index = spr_knightpepbump;
            image_index = floor((image_number - 1));
            state = states.knightpepbump;
            fmod_event_one_shot_3d("event:/sfx/pep/groundpound", x, y);
        }

I realized this problem when looking at your Eggplant Decomp, where it did the same thing, but didn't crash (and I already had my suspicions).

Also if you're interested, my web port github repo is here

burnedpopcorn commented 1 month ago

Alright, I looked the script within your repository, and yeah, seems like you fixed it (although its only one set of parenthesis, but I don't if that works or not)

femloy commented 1 month ago

Actually yeah it should be floor(image_number - 1) instead of floor(image_number) - 1 I'll fix that