Browse Source

Follow up bbe733e, typos

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh 10 years ago
parent
commit
34ca457ab0
2 changed files with 12 additions and 10 deletions
  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>"})
 *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.
 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
   1 = normal vending
   2 = using @autotrade
   2 = using @autotrade
-  4 = has buyingstore
+  4 = has a buyingstore
 
 
 Examples:
 Examples:
-	//This will check if Aaron's state
+	//This will check Aaron's state
 	.@state = checkvending("Aaron");
 	.@state = checkvending("Aaron");
 	if (.@state&1)
 	if (.@state&1)
 		mes "Aaron is currently vending!";
 		mes "Aaron is currently vending!";
+	if (.@state&4)
+		mes "Aaron has a buying store!";
 	if (.@state&2)
 	if (.@state&2)
 		mes "Aaron is autotrading!";
 		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 {
 	else {
 		int8 ret = 0;
 		int8 ret = 0;
 		if (sd->state.vending)
 		if (sd->state.vending)
-			ret |= 1;
+			ret = 1;
+		else if (sd->state.buyingstore)
+			ret = 4;
+
 		if (sd->state.autotrade)
 		if (sd->state.autotrade)
 			ret |= 2;
 			ret |= 2;
-		if (sd->state.buyingstore)
-			ret |= 4;
 		script_pushint(st, ret);
 		script_pushint(st, ret);
 	}
 	}
 	return SCRIPT_CMD_SUCCESS;
 	return SCRIPT_CMD_SUCCESS;