summaryrefslogtreecommitdiff
path: root/src/map/vending.c
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-12 00:35:48 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-12 00:35:48 +0000
commit22618c9ef3cd2eca23a5e9006637074d5b11cf76 (patch)
tree2aa7b82268d1a1feaf11d30d3767fa19dfaff32f /src/map/vending.c
parentae57ff81700dbe6714ef107b34510457e9c9c5b6 (diff)
downloadhercules-22618c9ef3cd2eca23a5e9006637074d5b11cf76.tar.gz
hercules-22618c9ef3cd2eca23a5e9006637074d5b11cf76.tar.bz2
hercules-22618c9ef3cd2eca23a5e9006637074d5b11cf76.tar.xz
hercules-22618c9ef3cd2eca23a5e9006637074d5b11cf76.zip
-Add/upd basic documentation for script.c
-Fix some indentation and strange codestyle change to A-Style git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16915 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/vending.c')
-rw-r--r--src/map/vending.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/vending.c b/src/map/vending.c
index 723cb014f..0f8255788 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -59,7 +59,7 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
{ // GM is not allowed to trade
clif_displaymessage(sd->fd, msg_txt(246));
return;
- }
+ }
sd->vended_id = vsd->vender_id; // register vending uid
@@ -139,11 +139,11 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
clif_buyvending(sd, idx, amount, 2); // you can not buy, because overweight
return;
}
-
+
//Check to see if cart/vend info is in sync.
if( vending[j].amount > vsd->status.cart[idx].amount )
vending[j].amount = vsd->status.cart[idx].amount;
-
+
// if they try to add packets (example: get twice or more 2 apples if marchand has only 3 apples).
// here, we check cumulative amounts
if( vending[j].amount < amount )
@@ -152,7 +152,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
return;
}
-
+
vending[j].amount -= amount;
switch( pc_checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) {
@@ -199,7 +199,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
{
if( vsd->vending[i].amount == 0 )
continue;
-
+
if( cursor != i ) // speedup
{
vsd->vending[cursor].index = vsd->vending[i].index;
@@ -233,18 +233,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
}
static int vending_checknearnpc_sub(struct block_list* bl, va_list args) {
struct npc_data *nd = (struct npc_data*)bl;
-
+
if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
return 0;
return 1;
}
bool vending_checknearnpc(struct block_list * bl) {
-
+
if( battle_config.min_npc_vending_distance > 0 &&
map_foreachinrange(vending_checknearnpc_sub,bl, battle_config.min_npc_vending_distance, BL_NPC) )
return true;
-
+
return false;
}
/*==========================================
@@ -284,8 +284,8 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
-
-
+
+
// filter out invalid items
i = 0;
for( j = 0; j < count; j++ )