summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-02 17:36:59 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-02 17:36:59 +0000
commit767b08018e035e1d04e7d83ea923a146626761f0 (patch)
treeb111819e70fb84200bef87bc8d567c84bff7130d /src/map/npc.c
parent65b3428fad4d6371253e8492cb1d1149eefafbb1 (diff)
downloadhercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.gz
hercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.bz2
hercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.xz
hercules-767b08018e035e1d04e7d83ea923a146626761f0.zip
Fixed wrong mvp format string for @mobinfo (would not show big mvp exp rewards correctly).
Added data length check to chrif_authok(), to detect a mismatch between charserver's and mapserver's mmo_charstatus structure size. Corrected some typos in the cash shop code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12277 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 37b8d99b8..b429b2ed0 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -110,6 +110,7 @@ int npc_enable_sub(struct block_list *bl, va_list ap)
//aFree(name);
return 0;
}
+
int npc_enable(const char* name, int flag)
{
struct npc_data* nd = strdb_get(npcname_db, name);
@@ -1022,7 +1023,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
{
struct npc_data *nd = (struct npc_data *)map_id2bl(sd->npc_shopid);
struct item_data *item;
- int i, prize, w;
+ int i, price, w;
if( !nd || nd->subtype != CASHSHOP )
return 1;
@@ -1060,16 +1061,16 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
if( w + sd->weight > sd->max_weight )
return 3;
- prize = nd->u.shop.shop_item[i].value * amount;
- if( points > prize )
- points = prize;
+ price = nd->u.shop.shop_item[i].value * amount;
+ if( points > price )
+ points = price;
- if( sd->cashPoints < prize - points )
+ if( sd->cashPoints < price - points )
return 6;
if( sd->kafraPoints < points )
return 6;
- pc_paycash(sd, prize, points);
+ pc_paycash(sd, price, points);
if( !pet_create_egg(sd, nameid) )
{
@@ -1673,7 +1674,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
if( value < 0 )
{
if( type == SHOP ) value = id->value_buy;
- else value = 0; // Cashshop don't have a "buy prize" in the item_db
+ else value = 0; // Cashshop doesn't have a "buy price" in the item_db
}
if( type == SHOP && value*0.75 < id->value_sell*1.24 )