浏览代码

Follow up 2cee5b6ff1bf53c4ae53bc1278b09ae84b8a0a76
* Revert `mercenary_create` command to don't return mercenary game id. Fixed #361

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>

Cydh Ramdh 10 年之前
父节点
当前提交
d495751d1d
共有 2 个文件被更改,包括 3 次插入6 次删除
  1. 0 2
      doc/script_commands.txt
  2. 3 4
      src/map/script.c

+ 0 - 2
doc/script_commands.txt

@@ -8361,8 +8361,6 @@ list of all available classes, see 'db/mercenary_db.txt'.
 
 This command is typically used in item scripts of mercenary scrolls.
 
-Returned value is the game ID of the spawned mercenary.
-
 ---------------------------------------
 
 *mercenary_heal <hp>,<sp>;

+ 3 - 4
src/map/script.c

@@ -13651,7 +13651,7 @@ BUILDIN_FUNC(getmercinfo)
 		{
 			ShowError("buildin_getmercinfo: No such character (char_id=%d).\n", char_id);
 			script_pushnil(st);
-			return 1;
+			return SCRIPT_CMD_FAILURE;
 		}
 	}
 	else
@@ -13659,7 +13659,7 @@ BUILDIN_FUNC(getmercinfo)
 		if( ( sd = script_rid2sd(st) ) == NULL )
 		{
 			script_pushnil(st);
-			return 0;
+			return SCRIPT_CMD_SUCCESS;
 		}
 	}
 
@@ -13683,7 +13683,7 @@ BUILDIN_FUNC(getmercinfo)
 		default:
 			ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id);
 			script_pushnil(st);
-			return 1;
+			return SCRIPT_CMD_FAILURE;
 	}
 
 	return SCRIPT_CMD_SUCCESS;
@@ -17292,7 +17292,6 @@ BUILDIN_FUNC(mercenary_create)
 
 	contract_time = script_getnum(st,3);
 	mercenary_create(sd, class_, contract_time);
-	script_pushint(st, sd->md->bl.id);
 
 	return SCRIPT_CMD_SUCCESS;
 }