diff options
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 696775cc2..2aee1c58c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1625,11 +1625,11 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4) if (value/124. < id->value_sell/75.) { //Clened up formula to prevent overflows.
printf("\r"); //Carriage return to clear the 'loading..' line. [Skotlex]
if (value < id->value_sell)
- ShowWarning ("Item %s [%d] buying price (%d) is less than selling price (%d)\n",
- id->name, id->nameid, value, id->value_sell);
+ ShowWarning ("Item %s [%d] buying price (%d) is less than selling price (%d) at %s\n",
+ id->name, id->nameid, value, id->value_sell, current_file);
else
- ShowWarning ("Item %s [%d] discounted buying price (%d) is less than overcharged selling price (%d)\n",
- id->name, id->nameid, value/100*75, id->value_sell/100*124);
+ ShowWarning ("Item %s [%d] discounted buying price (%d) is less than overcharged selling price (%d) at %s\n",
+ id->name, id->nameid, value/100*75, id->value_sell/100*124, current_file);
}
//for logs filters, atcommands and iteminfo script command
if (id->maxchance<=0)
@@ -2124,7 +2124,13 @@ static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *fir strncpy(p, w3, 50);
user_db = script_get_userfunc_db();
- strdb_put(user_db, p, script);
+ if(strdb_get(user_db, p) != NULL) {
+ printf("\r"); //Carriage return to clear the 'loading..' line. [Skotlex]
+ ShowWarning("parse_function: Duplicate user function [%s] (%s:%d)\n", p, file, *lines);
+ aFree(p);
+ script_free_code(script);
+ } else
+ strdb_put(user_db, p, script);
// もう使わないのでバッファ解放
aFree(srcbuf);
|