summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-31 01:17:03 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-31 01:17:03 +0000
commitd21f2f8479c618c15958ae1f9ac5811b9b035921 (patch)
tree0182c275b3d3431c33ace6709970adaabefdd5c0
parentc82d8121d5c52e42242d9f3f8be36f0aed569701 (diff)
downloadhercules-d21f2f8479c618c15958ae1f9ac5811b9b035921.tar.gz
hercules-d21f2f8479c618c15958ae1f9ac5811b9b035921.tar.bz2
hercules-d21f2f8479c618c15958ae1f9ac5811b9b035921.tar.xz
hercules-d21f2f8479c618c15958ae1f9ac5811b9b035921.zip
* Fixed a nullpo crash in pc_gainexp when receiving exp though script command getexp (topic:262958, since r14625).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14644 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Renewal.txt2
-rw-r--r--src/map/pc.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Changelog-Renewal.txt b/Changelog-Renewal.txt
index 858f42379..1ea2567f0 100644
--- a/Changelog-Renewal.txt
+++ b/Changelog-Renewal.txt
@@ -1,5 +1,7 @@
Date Added
+2010/12/30
+ * Fixed a nullpo crash in pc_gainexp when receiving exp though script command getexp (topic:262958, since r14625). [Ai4rei]
2010/12/27
* Added item stacking limit database (item_stack.txt) required for runes and other 3rd class related skill items. [Ai4rei]
* Merged fixes from trunk for script command 'checkweight' (r14631) and skill-based item production (r14633). [Ai4rei]
diff --git a/src/map/pc.c b/src/map/pc.c
index a444c7bba..e7ef23ce9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4940,7 +4940,7 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
{
float nextbp=0, nextjp=0;
unsigned int nextb=0, nextj=0;
- int leveldiff = sd->status.base_level - status_get_lv(src), modifier = 100;
+ int leveldiff = src ? ( sd->status.base_level - status_get_lv(src) ) : 0, modifier = 100;
nullpo_ret(sd);
if(sd->bl.prev == NULL || pc_isdead(sd))