Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1133
Description
Adds support for GMS2.3+ self calls in the compiler, cherrypicked from UndertaleModTool Community Edition.
Fixed an issue where sub functions in an object should be stored in a self variable without the object function name suffix.
Example: the utmt compiler would make
gml_Script_act_gml_Object_menu_chapter_btn_Create_0
be stored inself.act_gml_Object_menu_chapter_btn_Create_0
when the original game code hadself.act
.Caveats
None
Notes
I've tested this with Submachine Legacy (2023.8), and the one from #1133 (2022.5)
How to Reproduce:
Create a function in a GlobalScript or Object code, then call that function from another function
![image](https://private-user-images.githubusercontent.com/135391005/305668960-ab89fdf8-ac08-4267-8bfa-172e90a226de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDc2MzUsIm5iZiI6MTczOTY0NzMzNSwicGF0aCI6Ii8xMzUzOTEwMDUvMzA1NjY4OTYwLWFiODlmZGY4LWFjMDgtNDI2Ny04YmZhLTE3MmU5MGEyMjZkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQxOTIyMTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZjA2NWJkMzk3YWI4OWIzMWQyNGQ1NWVkNTQyMGVkZTk2MzE5ZTMzNWZmMmNiODZhOTIxMTAwOGViOWM0YWE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.duKEx65AmV_nj84WPYyP1Fh8NY__zXlSMlduSp-Abes)
In gamemaker (I've only tested this for 2023.8), make a function in an object, then call that function from another one in the same object
![image](https://private-user-images.githubusercontent.com/135391005/305669112-f38d12a5-4fc4-47a0-8e27-e603ecb7e5a7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDc2MzUsIm5iZiI6MTczOTY0NzMzNSwicGF0aCI6Ii8xMzUzOTEwMDUvMzA1NjY5MTEyLWYzOGQxMmE1LTRmYzQtNDdhMC04ZTI3LWU2MDNlY2I3ZTVhNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQxOTIyMTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01MzhhMjU1MjE1YjNjNTBjN2E3ZTEzNTU5OWQ5MTUyNTViYzdiZjJjMzI2MzU5NTg3M2EyZjhhYjgzYjA5NjUzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.4pcz5DH0fpzv_1uKJjs20tFmP6zzwgRkMKicl7d0iAU)