Mantis

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
ReporterMishMash 
Assigned ToRussell Kay 
PriorityMediumSeverityC - GeneralReproducibility100%
StatusClosedResolutionFixed 
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( other.id );
ChangeColour( self.id );

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.

http://yoyogames.zendesk.com/attachments/token/SCVXQ65QOTcJ88EyVaa9IECfd/?name=YYCselfAndOther_glitch.gmz [^]
Additional InformationOriginal helpdesk ticket: http://help.yoyogames.com/tickets/65289 [^]
GM Version1.99.170
Attached Files

- Relationships

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

Reproduced - assigned.
(0034271)
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...
(0034611)
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...
(0034633)
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.

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

Fixed in gitlab checkin 994324f
(0043641)
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