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

Deprecate *getunitname script command #2395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10165,10 +10165,17 @@ returns -1 if value could not be retrieved.

*getunitname(<GID>)

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ /!\ This command is deprecated @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Retrieve the name of a unit.

returns "Unknown" if the value could not be retrieved.

This command is deprecated and it should not be used in new scripts, as it is
likely to be removed at a later time. Please use rid2name instead.

---------------------------------------

*setunitname(<GID>, <Name>)
Expand Down
3 changes: 2 additions & 1 deletion src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -18449,6 +18449,7 @@ static BUILDIN(rid2name)
case BL_PET: script_pushstrcopy(st, BL_UCCAST(BL_PET, bl)->pet.name); break;
case BL_HOM: script_pushstrcopy(st, BL_UCCAST(BL_HOM, bl)->homunculus.name); break;
case BL_MER: script_pushstrcopy(st, BL_UCCAST(BL_MER, bl)->db->name); break;
case BL_ELEM: script_pushstrcopy(st, BL_UCCAST(BL_ELEM, bl)->db->name); break;
default:
ShowError("buildin_rid2name: BL type unknown.\n");
script_pushconststr(st,"");
Expand Down Expand Up @@ -25581,7 +25582,7 @@ static void script_parse_builtin(void)
/* Unit Data */
BUILDIN_DEF(setunitdata,"iiv??"),
BUILDIN_DEF(getunitdata,"ii?"),
BUILDIN_DEF(getunitname,"i"),
BUILDIN_DEF_DEPRECATED(getunitname,"i"), // Deprecated 2019-02-28
BUILDIN_DEF(setunitname,"is"),
BUILDIN_DEF(unitwalk,"ii?"),
BUILDIN_DEF(unitkill,"i"),
Expand Down