View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015583GameMaker Runner[All Projects] Windows (YYC)Public2014-08-05 11:052016-06-02 08:59
Assigned ToRussell Kay 
PriorityMediumSeverityC - GeneralReproducibility100%
PlatformWindows (YYC)OS OS Version
Summary0015583: Win(YYC): YYC glitch - passing other/self into functions.
DescriptionHi, I found this bug earlier. If you pass other or self into a function, then it will no longer work in the way you would expect with YYC vs regular Windows export.

I have tested this in the latest early access build, just to ensure it hadn't already been spotted.

I have this code:

ChangeColour( other );
ChangeColour( self );

In the collision event of the object. I appreciate that self is essentially pointless in most cases, as you can use "id", however other is quite important.

I will note that doing:

ChangeColour( );
ChangeColour( );

Works perfectly fine. (I read somewhere that other and self are always the same value, and are used for indicating the object calling the script, and any other potential object in the script.)

As far as i'm aware, this happens in every case where other/self exist, as in my main project, I was using self in the step event. There was also a situation where I was calling a function inside a with statement using other.

Anyway, if you pass it into a function then try to access an instance variable inside that function, it will return undefined, rather than a value.

It's easy enough to work around, however it may be causing some of those bugs that people have where games behave differently between YYC and the regular version, so I thought it was best to report it. [^]
Additional InformationOriginal helpdesk ticket: [^]
GM Version1.99.170
Attached Files

- Relationships

-  Notes
Neil Wicker (Updater)
2014-08-06 09:09

Reproduced - assigned.
Neil Wicker (Updater)
2014-11-19 16:31

Still happens in EA299, assigning on. Only assigned for consistency reasons, YYC is correct as self and other will just equate to their constant values (-2 and -1). Using these in the way above is certainly undefined behavior...
Russell Kay (Manager)
2014-12-08 14:10

OK technically this is not a bug... though I think that it could be handled better...

other and self are actually constant numbers (-2 and -1 for the record) they are not references to what you think...

I will take a look and see if it could be handled better by the YYC compiler...
rcusumano (Updater)
2014-12-09 13:12
edited on: 2014-12-09 13:13

Okay, but still, going down the stack shouldn't break the scope, even if (-2) is used instead. Only a with statement should change that I believe.

Russell Kay (Manager)
2016-05-23 21:19

Fixed in gitlab checkin 994324f
Daniel Cleaton (Administrator)
2016-06-02 08:59

Verifying in EA478. Closing. Fix will be in next EA/Beta releases.

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker