瀏覽代碼

Follow up bbe733e, typos

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh 10 年之前
父節點
當前提交
34ca457ab0
共有 2 個文件被更改,包括 12 次插入10 次删除
  1. 8 7
      doc/script_commands.txt
  2. 4 3
      src/map/script.c

+ 8 - 7
doc/script_commands.txt

@@ -3568,24 +3568,25 @@ warg and 0 if they don't.
 
 *checkvending({"<Player Name>"})
 
-Checks if the player is vending or has buyingstore.
+Checks if the player is vending or has has a buyingstore. Additionally
+it gives you the information whether the player uses autotrade or not.
 Name is optional, and defaults to the attached player if omitted.
 
-The returned values are bitmask of.
-  0 = not vending, doesn't have buyingstore, & not autotrading
+The returned value is bitmask of.
+  0 = doesn't have a vending or buyingstore (which also means he can't use autotrade)
   1 = normal vending
   2 = using @autotrade
-  4 = has buyingstore
+  4 = has a buyingstore
 
 Examples:
-	//This will check if Aaron's state
+	//This will check Aaron's state
 	.@state = checkvending("Aaron");
 	if (.@state&1)
 		mes "Aaron is currently vending!";
+	if (.@state&4)
+		mes "Aaron has a buying store!";
 	if (.@state&2)
 		mes "Aaron is autotrading!";
-	if (.@state&4)
-		mes "Aaron has buying store!";
 
 ---------------------------------------
 

+ 4 - 3
src/map/script.c

@@ -15953,11 +15953,12 @@ BUILDIN_FUNC(checkvending) {
 	else {
 		int8 ret = 0;
 		if (sd->state.vending)
-			ret |= 1;
+			ret = 1;
+		else if (sd->state.buyingstore)
+			ret = 4;
+
 		if (sd->state.autotrade)
 			ret |= 2;
-		if (sd->state.buyingstore)
-			ret |= 4;
 		script_pushint(st, ret);
 	}
 	return SCRIPT_CMD_SUCCESS;