From: parking_turkeys Date: Wed, 15 Jul 2026 12:01:18 +0000 (-0400) Subject: remove code added for fixing bug X-Git-Tag: broken~1 X-Git-Url: http://git.parking-turkeys.net/?a=commitdiff_plain;h=ed062fde16fddedb0ec859b4ccd7e17810b96718;p=aichan-platformer.git remove code added for fixing bug --- diff --git a/level.c b/level.c index 0a20ae8..5eca124 100644 --- a/level.c +++ b/level.c @@ -76,22 +76,11 @@ int on_floor(struct Rectangle *rect) //on floor == no overlap but right next to int drawdialogue(void) { - struct dialogue dlg = stages[level].dialogues[current_dialogue]; - printf("g"); //grab dialogue + struct dialogue *dlg = &(stages[level].dialogues[current_dialogue]); DrawRectangle(0,DLGY,640,DLGHEIGHT,RAYWHITE); - printf("r"); //rectange - //drawcharname(dlg.charaname,dlg.characolour); - DrawText(dlg.charaname,DLGPADDING,DLGY + DLGPADDING,CHARANAMETEXTSIZE,dlg.characolour); - printf("n"); //name THIS IS WHERE IT CRASHES - drawcharimage(dlg.image); - printf("i"); //image THIS CRASHES TOO?? ig... the issue is with dlg->???? but specifically when the function uses it... AND SPECIFICALLY WHEN IT'S A STRING - // so... our mystery bug has these traits: - //only happens on the second level played (NOT only on level == 1. If you manually set level to 1 at the start it crashes on entering stages[2] instead. - //happens when a property of dlg is accessed in one of functions and used to do smth (so it doesn't crash if it's just entered into the function) (although maybe that's bc of compiler??) - //it also happens if DrawText (and presumably the other ones too) are attempted inside of drawdialogue(). - //the property must be a string. - drawdialogueline(dlg.line); - printf("l"); //line + drawcharname(dlg->charaname,dlg->characolour); + drawcharimage(dlg->image); + drawdialogueline(dlg->line); return 1; }; diff --git a/main_v2.c b/main_v2.c index 9fd1479..37128f2 100644 --- a/main_v2.c +++ b/main_v2.c @@ -49,6 +49,6 @@ int next_level(void) level += 1; //printf("incremented level"); frozen = 1; - printf("set frozen\n"); + //printf("set frozen\n"); return 1; }