浏览代码

* Fixed a nullpo crash in pc_gainexp when receiving exp though script command getexp (topic:262958, since r14625).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/renewal@14644 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 年之前
父节点
当前提交
9256dbfc80
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      Changelog-Renewal.txt
  2. 1 1
      src/map/pc.c

+ 2 - 0
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]

+ 1 - 1
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))