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

Functions not working when passing empty list variable #3687

Closed
bloggy opened this issue Jan 11, 2021 · 1 comment
Closed

Functions not working when passing empty list variable #3687

bloggy opened this issue Jan 11, 2021 · 1 comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@bloggy
Copy link

bloggy commented Jan 11, 2021

Description

Functions not working correctly when passing an empty list variable to them.

Steps to Reproduce

The script:

function testfunc(l: objects):
	broadcast "something"

command /testing [<text>] [<text>]:
	trigger:
		testfunc({_temp::*})

Result should be:
"something" in the chat.
But nothing happens. (not even a console error)

Now if you add an element to the list variable like this, it will work:

function testfunc(l: objects):
	broadcast "something"

command /testing [<text>] [<text>]:
	trigger:
		add "red" to {_temp::*}
		testfunc({_temp::*})

result: "something" in chat

Expected Behavior

The code in the functions should be executed, even when you pass an empty list variable to it.

Server Information

  • Server version/platform: Tuinity 1.16.4
  • Skript version: 2.5.3
@ShaneBeee ShaneBeee added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). labels Jan 23, 2021
@TPGamesNL
Copy link
Member

TPGamesNL commented Mar 13, 2021

Cause:

if (params.length > 0 && params[0].length == 0) // Parameters exist, but parameters are not of the correct type
return null;

Doesn't only apply for lists, it's basically anywhere the first parameter isn't set.

@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Mar 23, 2021
@TPGamesNL TPGamesNL added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels May 8, 2021
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. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

3 participants