Well it appears we need to get on this. Basically I don't why Josh, you think that negative numbers are not boolean true, according to C99 ISO any integer value that does not equate to 0 is boolean true when cast.
http://stackoverflow.com/questions/4254318/are-negative-boolean-values-definedยง 6.3.1.2
When any scalar value is converted to _Bool, the result is 0 if the value compares equal to 0; otherwise, the result is 1.
So my question is basically this, what is wrong with our compiler that it is not working for collision functions that return -4 (noone)
Also, Studio does continue this behavior from the earlier versions of Game Maker as I have tested the following code which does show a message box with -4 in it.
if (noone) {
show_message(string(noone));
}
I only began questioning this after looking at the following code from a tutorial game that comes with Stupido I got running now that I added event inheritance.
first_instance = collision_line(x, y, xx, yy, obj_Col_Parent, true, true);
if first_instance != noone
{
dx = xx - x;
dy = yy - y;
while (abs(dx) >= 1 || abs(dy) >= 1)
{
dx /= 2;
dy /= 2;
instance = collision_line(x, y, xx - dx, yy - dy, obj_Col_Parent, true, true);
if (instance != noone)
I only got curious because for some reason they took the extra precaution with the result of the collision functions. I am really failing to see something here.
Here is a picture of the game...
I just ran this same test in ENIGMA and I get the expected results. So what exactly is the issue with the collision functions again and why they don't behavior properly as the result of negative values?