Skip to content

Commit

Permalink
Follow up to 9c2026d
Browse files Browse the repository at this point in the history
* Renamed atcommand reloadnpc to reloadnpcfile.
* Adjusted documentation to fit.
  • Loading branch information
aleos89 committed Jan 25, 2017
1 parent 9c2026d commit 6542773
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion conf/msg_conf/map_msg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@

732: Item cannot be opened when your inventory is full.

733: Please enter a NPC name (usage: @reloadnpc <NPC_name>).
733: Please enter a NPC file name (usage: @reloadnpcfile <file name>).

// @cloneequip/@clonestat
734: Cannot clone your own %s.
Expand Down
6 changes: 3 additions & 3 deletions doc/atcommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1435,13 +1435,13 @@ Example:

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

@reloadnpc <npc name>
@reloadnpcfile <path>

Unloads and loads an NPC.
Same as @unloadnpc and @loadnpc but ran as one command.
Same as @unloadnpcfile and @loadnpc but ran as one command.

Example:
@reloadnpc npc/custom/jobmaster.txt
@reloadnpcfile npc/custom/jobmaster.txt

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

Expand Down
10 changes: 5 additions & 5 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -4648,23 +4648,23 @@ ACMD_FUNC(unloadnpc)
return 0;
}

ACMD_FUNC(reloadnpc) {
ACMD_FUNC(reloadnpcfile) {
if (!message || !*message) {
clif_displaymessage(fd, msg_txt(sd,733)); // Please enter a NPC name (usage: @reloadnpc <NPC_name>).
clif_displaymessage(fd, msg_txt(sd,733)); // Please enter a NPC file name (usage: @reloadnpcfile <file name>).
return -1;
}

if (npc_unloadfile(message))
clif_displaymessage(fd, msg_txt(sd,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.

if (!npc_addsrcfile(message, true)) {
clif_displaymessage(fd, msg_txt(sd,261));
clif_displaymessage(fd, msg_txt(sd,261)); // Script could not be loaded.
return -1;
}

npc_read_event_script();

clif_displaymessage(fd, msg_txt(sd,262));
clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded.
return 0;
}

Expand Down Expand Up @@ -10080,7 +10080,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(hidenpc),
ACMD_DEF(loadnpc),
ACMD_DEF(unloadnpc),
ACMD_DEF(reloadnpc),
ACMD_DEF(reloadnpcfile),
ACMD_DEF2("time", servertime),
ACMD_DEF(jail),
ACMD_DEF(unjail),
Expand Down

0 comments on commit 6542773

Please sign in to comment.