summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-10 14:28:08 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-10 14:28:08 +0000
commitb7a0d413a1a4622e8ad745c210e735bd24c8ee3f (patch)
treec8ce8b1b77d8b1761da763ca2c4ac1df31b5509c /src/map/npc.c
parent86354787809a85d57593dc6c1940262752d5b846 (diff)
downloadhercules-b7a0d413a1a4622e8ad745c210e735bd24c8ee3f.tar.gz
hercules-b7a0d413a1a4622e8ad745c210e735bd24c8ee3f.tar.bz2
hercules-b7a0d413a1a4622e8ad745c210e735bd24c8ee3f.tar.xz
hercules-b7a0d413a1a4622e8ad745c210e735bd24c8ee3f.zip
* Fixed a variable loopback problem on NPC shop price checking routine.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5559 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 184b56eea..7ba8be5d5 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1747,7 +1747,7 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4)
value = id->value_buy;
nd->u.shop_item[pos].value = value;
// check for bad prices that can possibly cause exploits
- if (value*75/100 < id->value_sell*124/100) {
+ if (value/100*75 < id->value_sell/100*124) { // Modified to prevent loopbacks, divide before multiplying [Lance]
printf("\r"); //Carriage return to clear the 'loading..' line. [Skotlex]
ShowWarning ("Item %s [%d] buying price (%d) is less than selling price (%d)\n",
id->name, id->nameid, value*75/100, id->value_sell*124/100);