Enterbrain Bitmap fail

Started by Blizzard, August 18, 2011, 12:26:37 pm

Previous topic - Next topic

Blizzard

I just found a bug by Enterbrain that nobody has ever found before. If you try to create a Bitmap instance with width > 0 and height != 0, it will use the absolute value of the height instead of crashing for values <= 0 (it still crashes with height = 0, though)! :O
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Zeriab


Blizzard

August 18, 2011, 03:55:14 pm #2 Last Edit: August 18, 2011, 03:56:25 pm by Blizzard
I wouldn't have found it usually. I was trying to get CP running on ARC, but it would always crash when it's supposed to start a battle. I had to figure out what was going so after some time I found out that the height value was negative when the Bitmap was created. I ran it in RMXP and it worked fine. Then I found out that the negative value actually works which I then confirmed by trying this:

b = Bitmap.new(16, -32) # does not crash
p b.height # prints 32
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Oh! That is interesting! Wait to go Enterbrain.

AngryPacman

Hang on, Enterbrain did something unneeded and cool?
G_G's a silly boy.

Subsonic_Noise

I have no clue what this is about.

ForeverZer0

Its really not cool. It hides possible errors in your scripts.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Like that one script in CP where I found the error originally. >:|
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

AngryPacman

Well, if it wasn't picked up earlier then obviously it wasn't a noticeable or big error.
G_G's a silly boy.