YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
26 stars 8 forks source link

In-Game: Using function() in a macro definition causes all functions created using that macro to become the last one created #6525

Closed BenjaminUrquhart closed 4 months ago

BenjaminUrquhart commented 4 months ago

Description

When using function() inside of a macro, it appears all function definitions that make use of the macro will overwrite each other, meaning the last function in the code entry will be used for all of them.

For example, if I define function A normally, then use a function() macro for functions B, C, and D, calling A works fine but calling B, C, or D will always result in calling D.

This did not happen in 2024.4 and earlier.

To clarify, I am not putting the entire function in the macro, I am just putting function() in it and writing the function bodies outside of the macro.

Project and Logs

Expected Change

Using function() in a macro should create discrete functions instead of overwriting them.

Steps To Reproduce

  1. Start GameMaker
  2. Open your project
  3. Make a macro that ends with function() - #macro FUNC function() is sufficient
  4. Define 2 functions with the macro within the same code entry
  5. Call the first function
  6. Observe the second function being called instead. You can even place the second function definition after calling the first and it will still call the second.

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.6.0 (Monthly)

Which operating system(s) are you seeing the problem on?

Windows 10

Which platform(s) are you having trouble building this project for?

Windows

Are you running GameMaker from inside your Steam library?

Yes

Contact Us Package Attached?

Sample Project Added?

backYard321 commented 4 months ago

YES, I was experiencing issues with functions in macros but couldn't figure out exactly what the problem was. Hoping a fix for this can be covered in 2024.6.1, not sure whether it's tied to #6506

rwkay commented 4 months ago

Fixed in 2024.8

mgeddesGM commented 4 months ago

verified as of IDE v2024.800.0.591 Runtime v2024.800.0.615

YYDan commented 3 months ago

Can see that this has had a follow-up fix, as it broke projects such as https://github.com/YoYoGames/GameMaker-Bugs/issues/6864 - we will need to re-verify.

sihammill commented 3 months ago

Verified in IDE v2024.800.0.600 Runtime v2024.800.0.623