• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GM:S (1.4.1804) debugger step-in problem

P

Peter Szabo Gabor

Guest
Hello,

Me, again. Sorry for the second post within a day.
Let's say, I have the following if - else blocks.

if sprite_get_width(sID) <= global.tileW and sprite_get_height(sID) <= global.tileH
{ // within global sizes allowed for tiles: load
ds_list_add(global.tileIDs, sID);
ds_list_add(global.tileNames, filename_name(sTmp) + filename_ext(sTmp));
nRC = nRC + 1;
}
else
{ // too big: delete
sprite_delete(sID);
}​

This part is simply within a script where I load sprites dynamically from a folder (to use as a texture), and if the sprite is too big, it simpy deletes it. This part decides if the sprite was too big. The sprite's ID (returned by the sprite_add GML function) is in the variable "sID".

The sprite's ID is added to a DS list for further use, such as it's name.

When I debug it, and I use the step-in (F11) key, to check how it goes, it does something very strange (the debugger is strange, not the code).

It first evaluates the IF part, and goes into the IF block (adds the sprites ID, adds the name, and increase nRC by 1).
Then it goes into the ELSE part(!) when the inverse line is on the nRC = nRC + 1; line, after I press F11 it goes to the sprite_delete(sID); line!!!
It is very confusing, and annoying....
I think the code debugging line should jump to the first line AFTER the else.

Do I do something wrong? The code seems to be working though, when I check (within the debugger) the graphical resources, the sprites are there (the numbers are increasing etc...)

This debugger really kills me.
Thanks for any advice,
KR,
Peter
 
Top