-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In-Game: Add support for "other" to be the originating "self" when used inside methods #7349
Comments
I think that it also doesn't work as it should in case of instances, and local functions, but I was waiting to check it and report correctly until #7125 comes into beta, as that could change a lot. |
This is not a bug as the |
* When a method call is made and the `self` is changed to the bound struct then set `other` to be the previous `self` * If `new` calls a constructor on a bound method then ensure `other` is set to the bound `self`, otherwise it is the `self` from the new callsite. * Address feature request - YoYoGames/GameMaker-Bugs#7349
Use this project for testing... |
After discussion with Kat we have revised some of the rules around handling The central principle is that when the current
To fit with the central principle we have introduced another point where
We will make this change in 2024.10 - we expect the impact will be minimal (let us know if that is not the case) |
Added in 2024.10 |
That new case sounds super useful! |
other
result when used inside of method
functions
verified as of IDE v2024.1100.0.626 Runtime v2024.1100.0.652 |
This appears to only be implemented in YYC, not VM, in 2024.1100.0.652. Testing with the following code:
In YYC, the message prints the struct:
In VM, it prints the object:
|
Updated fix in 2024.11 |
Verified across vm,yyc,html5 on all attached projects IDE v2024.1100.0.646 Runtime v2024.1100.0.666 |
Description
For the following GML code:
The
self
inside of thef()
call is correctlyglobal.c
, butother
ends up beingglobal.a
. After a discussion with Russell, this shouldn't be the case, and insteadother
should equalglobal.b
in this example.Expected Change
Change
other
to be the "self" of the calling scope, when used inside of bound functionsSteps To Reproduce
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.6.2 (Monthly)
Which platform(s) are you seeing the problem on?
Windows, HTML5
Contact Us Package Attached?
Sample Project Added?
The text was updated successfully, but these errors were encountered: