Prevent unloadnpc script command to unload the invoking NPC. (#3000)
* Prevent unloadnpc script command to unload the invoking NPC. Addressed #2999
This commit is contained in:
parent
bde3aeb9e8
commit
41ea1531bc
@ -23391,6 +23391,10 @@ BUILDIN_FUNC(unloadnpc) {
|
|||||||
if( nd == NULL ){
|
if( nd == NULL ){
|
||||||
ShowError( "buildin_unloadnpc: npc '%s' was not found.\n", name );
|
ShowError( "buildin_unloadnpc: npc '%s' was not found.\n", name );
|
||||||
return SCRIPT_CMD_FAILURE;
|
return SCRIPT_CMD_FAILURE;
|
||||||
|
} else if ( nd->bl.id == st->oid ) {
|
||||||
|
// Supporting self-unload isn't worth the problem it may cause. [Secret]
|
||||||
|
ShowError("buildin_unloadnpc: You cannot self-unload NPC '%s'.\n.", name);
|
||||||
|
return SCRIPT_CMD_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
npc_unload_duplicates(nd);
|
npc_unload_duplicates(nd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user