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

Message effect can have double evaluation of its message content #4952

Open
1 task done
TPGamesNL opened this issue Jul 24, 2022 · 0 comments
Open
1 task done

Message effect can have double evaluation of its message content #4952

TPGamesNL opened this issue Jul 24, 2022 · 0 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@TPGamesNL
Copy link
Member

Skript/Server Version

Skript 2.6.3, Paper 1.19

Bug Description

Using the message effect with both a player and console as receivers, and the message content being a VariableString (or formatted expression), the VariableString will be evaluted twice, resulting in for example a function in it being called twice.

Expected Behavior

To only call the VariableString getter once.

Steps to Reproduce

function test() :: number:
	broadcast "func call"
	return 2

command /test:
	trigger:
		message "abc %test()%" to console and all players

Run /test, with at least one player online. Function is called twice

Errors or Screenshots

No response

Other

Fixing this would likely require some more API, as we'd need to be able to convert a list of MessageComponents back to text, which we don't have any methods for AFAIK

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
@TPGamesNL TPGamesNL added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Jul 24, 2022
@APickledWalrus APickledWalrus added the PR available Issues which have a yet-to-be merged PR resolving it label Jul 26, 2022
@APickledWalrus APickledWalrus removed the PR available Issues which have a yet-to-be merged PR resolving it label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

2 participants