summaryrefslogtreecommitdiff
path: root/src/map/vending.c
diff options
context:
space:
mode:
authorValaris <Valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-05 17:53:53 +0000
committerValaris <Valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-05 17:53:53 +0000
commitde5a209e56a3296e70b63a94e014fbc0485e38cc (patch)
treef1a8a679e2655f255cc5f5e79f91af097121677e /src/map/vending.c
parent88b47855338b6b8b25bd94522d9ee8c7fe3c6529 (diff)
downloadhercules-de5a209e56a3296e70b63a94e014fbc0485e38cc.tar.gz
hercules-de5a209e56a3296e70b63a94e014fbc0485e38cc.tar.bz2
hercules-de5a209e56a3296e70b63a94e014fbc0485e38cc.tar.xz
hercules-de5a209e56a3296e70b63a94e014fbc0485e38cc.zip
* Added some of eAIRC bot code, written by me and LittleWolf. It is disabled and has no configuration options yet, as it is not finished. [Valaris]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5201 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/vending.c')
-rw-r--r--src/map/vending.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/map/vending.c b/src/map/vending.c
index 53fa281f3..c2f0e2f5e 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -16,17 +16,20 @@
#include "battle.h"
#include "log.h"
+#include "irc.h"
+
/*==========================================
* IX
*------------------------------------------
*/
void vending_closevending(struct map_session_data *sd)
{
-
nullpo_retv(sd);
sd->vender_id=0;
clif_closevendingboard(&sd->bl,0);
+ if(use_irc && irc_announce_shop_flag)
+ irc_announce_shop(sd,0);
}
/*==========================================
@@ -105,11 +108,11 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
z += ((double)vsd->vending[j].value * (double)amount);
if (z > (double)sd->status.zeny || z < 0. || z > (double)MAX_ZENY) { // fix positiv overflow (buyer)
clif_buyvending(sd, idx, amount, 1); // you don't have enough zeny
- return; // zenys'<
+ return; // zeny s'<
}
if (z + (double)vsd->status.zeny > (double)MAX_ZENY) { // fix positiv overflow (merchand)
clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
- return; // zenys'<
+ return; // zeny s'<
}
w += itemdb_weight(vsd->status.cart[idx].nameid) * amount;
if (w + sd->weight > sd->max_weight) {
@@ -252,9 +255,11 @@ void vending_openvending(struct map_session_data *sd,int len,char *message,int f
sd->vender_id = sd->bl.id;
sd->vend_num = i;
memcpy(sd->message,message, MESSAGE_SIZE-1);
- if (clif_openvending(sd,sd->vender_id,sd->vending) > 0)
+ if (clif_openvending(sd,sd->vender_id,sd->vending) > 0){
clif_showvendingboard(&sd->bl,message,0);
- else
+ if(use_irc && irc_announce_shop_flag)
+ irc_announce_shop(sd,1);
+ } else
sd->vender_id = 0;
}
}