瀏覽代碼

- Devotion absorbed damage will now appear to come from oneself (instead of the original attacker changing directions towards the Crusader)
- Updated clif_refres to send inventory, cart, and weight info.
- Fixed intif_guild_memberinfoshort to not leave a dangling pointer when someone logs out <.<
- Cleaned up a bit guild_check_member


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7226 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 年之前
父節點
當前提交
370e1df5bd
共有 5 個文件被更改,包括 38 次插入28 次删除
  1. 5 0
      Changelog-Trunk.txt
  2. 8 1
      src/map/clif.c
  3. 23 25
      src/map/guild.c
  4. 1 1
      src/map/pc.c
  5. 1 1
      src/map/status.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/06/17
+	* Devotion absorbed damage will now appear to come from oneself (instead of
+	  the original attacker changing directions towards the Crusader) [Skotlex]
+	* Updated clif_refres to send inventory, cart, and weight info. [Skotlex]
+	* Fixed intif_guild_memberinfoshort to not leave a dangling pointer when
+	  someone logs out <.< [Skotlex]
 	* Changed some mapflags related to the eye of hellion quest. [MasterOfMuppets]
 	* [Added]:
 	  - buildin_checkcell, buildin_mobwarp, buildin_pcattack.

+ 8 - 1
src/map/clif.c

@@ -7554,7 +7554,14 @@ int clif_specialeffect(struct block_list *bl, int type, int flag)
 int clif_refresh(struct map_session_data *sd) {
 	nullpo_retr(-1, sd);
 	clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
-	map_foreachinarea(clif_getareachar,sd->bl.m,sd->bl.x-AREA_SIZE,sd->bl.y-AREA_SIZE,sd->bl.x+AREA_SIZE,sd->bl.y+AREA_SIZE,BL_ALL,sd);
+	clif_inventorylist(sd);
+	if(pc_iscarton(sd)){
+		clif_cartlist(sd);
+		clif_updatestatus(sd,SP_CARTINFO);
+	}
+	clif_updatestatus(sd,SP_MAXWEIGHT);
+	clif_updatestatus(sd,SP_WEIGHT);
+	map_foreachinrange(clif_getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
 	return 0;
 }
 

+ 23 - 25
src/map/guild.c

@@ -490,9 +490,9 @@ int guild_npc_request_info(int guild_id,const char *event)
 }
 
 // 所属キャラの確認
-int guild_check_member(const struct guild *g)
+int guild_check_member(struct guild *g)
 {
-	int i, users;
+	int i, j, users;
 	struct map_session_data *sd, **all_sd;
 
 	nullpo_retr(0, g);
@@ -500,21 +500,15 @@ int guild_check_member(const struct guild *g)
 	all_sd = map_getallusers(&users);
 	
 	for(i=0;i<users;i++){
-		if((sd=all_sd[i])){
-			if(sd->status.guild_id==g->guild_id){
-				int j,f=1;
-				for(j=0;j<MAX_GUILD;j++){	// データがあるか
-					if(	g->member[j].account_id==sd->status.account_id &&
-						g->member[j].char_id==sd->status.char_id)
-						f=0;
-				}
-				if(f){
-					sd->status.guild_id=0;
-					sd->state.guild_sent=0;
-					sd->guild_emblem_id=0;
-					if(battle_config.error_log)
-						ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
-				}
+		sd=all_sd[i];
+		if(sd->status.guild_id==g->guild_id){
+			j=guild_getindex(g,sd->status.account_id,sd->status.char_id);
+			if (j < 0) {
+				sd->status.guild_id=0;
+				sd->state.guild_sent=0;
+				sd->guild_emblem_id=0;
+				if(battle_config.error_log)
+					ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
 			}
 		}
 	}
@@ -893,19 +887,23 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 	intif_guild_memberinfoshort(g->guild_id,
 		sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
 
+	if(!online) //REMOVE sd pointer or you get a dangling pointer! [Skotlex]
+	{
+		int i = guild_getindex(g,sd->status.account_id,sd->status.char_id);
+		if (i >= 0)
+			g->member[i].sd = NULL;
+	}
+	
 	if(sd->state.guild_sent)
 		return 0;
 
-	guild_check_conflict(sd); // mystery check
+//	guild_check_conflict(sd); // Check if char belongs to more than one guild? Should be unneeded.
 		
-	if(sd->status.guild_id == g->guild_id){
+	clif_guild_belonginfo(sd,g);
+	clif_guild_notice(sd,g);
 	
-		clif_guild_belonginfo(sd,g);
-		clif_guild_notice(sd,g);
-		
-		sd->state.guild_sent = 1;
-		sd->guild_emblem_id = g->emblem_id;
-	}
+	sd->state.guild_sent = 1;
+	sd->guild_emblem_id = g->emblem_id;
 	
 	return 0;
 }

+ 1 - 1
src/map/pc.c

@@ -7236,7 +7236,7 @@ int pc_readdb(void)
 			max_level[job][type]--;
 		if (max_level[job][type] < max) {
 			ShowWarning("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", max, job, max_level[job][type]);
-			ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n");
+			ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n", max);
 			max_level[job][type] = max;
 		}
 //		ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job, max_level[job][type]);

+ 1 - 1
src/map/status.c

@@ -572,7 +572,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
 				struct map_session_data *sd2 = map_id2sd(sc->data[SC_DEVOTION].val1);
 				if (sd2 && sd2->devotion[sc->data[SC_DEVOTION].val2] == target->id)
 				{
-					clif_damage(src, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
+					clif_damage(&sd2->bl, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
 					status_fix_damage(NULL, &sd2->bl, hp, 0);
 					return 0;
 				}