Carpet

Carpet

2M Downloads

Incorrect deprecated message in some usages of scoreboard_add()

IceWolf23 opened this issue ยท 8 comments

commented

Using scoreboard_add() method, when loading the app it print in chat;
image

But, in the Doc File are no replacement.

commented

That only happens if you're trying to create a scoreboard that already exists.

commented

That only happens if you're trying to create a scoreboard that already exists.

Well, but why that happen?
Wouldn't it be more practical to have the scoreboard creation method return false if it already exists and true if it created it?

without printing this "warning" in the chat to the player when they load the script

commented

You can modify an existing scoreboard with some other function, that's what the deprecation warning is trying to suggest.

I believe the function to do this is scoreboard_property.

commented

You can modify an existing scoreboard with some other function, that's what the deprecation warning is trying to suggest.

I believe the function to do this is scoreboard_property.

I understood this, what I'm trying to say is that the script that from that error doesn't modify any existing scoreboard, but the only thing it does is create it if it doesn't exist, consequently it seems more correct to do so that the scoreboard_add function returns a Bolean value whether or not the scoreboard already exists, rather than the warning for the deprecated method for editing an already existing scoreboard.

commented

You can check if a scoreboard exists with some other function quite sure, if you can't then that's an issue.

If you hit a deprecated path I'd really recommend to try to migrate, it means there's another (usually better/more efficient) way to do it, and deprecated functions and usages will get removed at some point.

This change was done in #753.

commented

You can check if a scoreboard exists with some other function quite sure, if you can't then that's an issue.

If you hit a deprecated path I'd really recommend to try to migrate, it means there's another (usually better/more efficient) way to do it, and deprecated functions and usages will get removed at some point.

This change was done in #753.

that's not what I mean
I have a script install.sc

inside the .sc :

scoreboard_add('Level', 'dummy');
scoreboard_add('Progress', 'dummy');
scoreboard_add('Mana', 'dummy')

when this script is executed what it does is only create the scoreboard in case they do not exist but it does not in any way modify the already existing scoreboards, consequently no warning should pop up for the deprecated use of the method

commented

Oh I now see what you mean, then I don't think that's intended to be deprecated, it is a bug in the check for displaying the warning.

commented

Oh I now see what you mean, then I don't think that's intended to be deprecated, it is a bug in the check for displaying the warning.

That's what i mean, thanks ^^