Skip to content
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

add user_pcall variant that doesn't throw #2315

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

Byrth
Copy link
Contributor

@Byrth Byrth commented Sep 11, 2023

Tested using your example code and it no longer failed.

test1.lua:

print('test1 file')

a = 10

function file_unload()
    print(dummy.lol)
end

test2.lua:

print('test2 file')

b = 10

I toggle between the two using gs load test1 or gs load test2. Can check which file is loaded (or if both are somehow loaded) by toggling gs debugmode on and using gs eval print(user_env.a, user_env.b)

Before this patch, it fails to unload test1 and a always takes a value of 10. After the patch, it does successfully unload test1 and loads test2, so a goes to nil and b goes to 10. Swapping back and forth results in the expected changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Addon][Gearswap] Faulty file_unload() function prevents unloading/changing profile.
1 participant