diff options
author | Haru <haru@dotalux.com> | 2019-07-28 19:20:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-28 19:20:03 +0200 |
commit | 754f7fe5752d3f22bb2a23eb27cbd2f9244533a7 (patch) | |
tree | 20bece5bf218b565f5fa97068708e6a2d4623f07 /src/char/char.c | |
parent | 8964a0c278390bd87f34cad5ad0ddd5f3d002f06 (diff) | |
parent | 2793fa142be02e91f43a831366db232f80940d21 (diff) | |
download | hercules-754f7fe5752d3f22bb2a23eb27cbd2f9244533a7.tar.gz hercules-754f7fe5752d3f22bb2a23eb27cbd2f9244533a7.tar.bz2 hercules-754f7fe5752d3f22bb2a23eb27cbd2f9244533a7.tar.xz hercules-754f7fe5752d3f22bb2a23eb27cbd2f9244533a7.zip |
Merge pull request #2502 from Emistry/family_failsafe_check
Fix family check and EXP bug
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index cad28b373..c5afc0f63 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2273,6 +2273,8 @@ static int char_char_married(int pl1, int pl2) static int char_char_child(int parent_id, int child_id) { + if (parent_id == 0 || child_id == 0) // Failsafe, avoild querys and fix EXP bug dividing with lower level chars + return 0; if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `child` FROM `%s` WHERE `char_id` = '%d'", char_db, parent_id) ) Sql_ShowDebug(inter->sql_handle); else if( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) @@ -2292,6 +2294,8 @@ static int char_char_child(int parent_id, int child_id) static int char_char_family(int cid1, int cid2, int cid3) { + if (cid1 == 0 || cid2 == 0 || cid3 == 0) //Failsafe, and avoid querys where there is no sense to keep executing if any of the inputs are 0 + return 0; if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `char_id`,`partner_id`,`child` FROM `%s` WHERE `char_id` IN ('%d','%d','%d')", char_db, cid1, cid2, cid3) ) Sql_ShowDebug(inter->sql_handle); else while( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) |