Browse Source

- Applied the necessary changes to make @partyoption reflect it's changes on the alt+p window.
- Some code indentation cleanups.


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

skotlex 19 years ago
parent
commit
3d18f93d8e
7 changed files with 23 additions and 22 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/battle.c
  3. 3 6
      src/map/charsave.c
  4. 1 1
      src/map/chat.c
  5. 5 8
      src/map/guild.c
  6. 2 2
      src/map/mob.c
  7. 8 3
      src/map/party.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/07/26
+	* Applied the necessary changes to make @partyoption reflect it's changes
+	  on the alt+p window. [Skotlex]
 	* Modified party_item_share_type config setting so that using 1 disables
 	  item-sharing from non-mob loot (player dropped items or pet loot) and 2
 	  enables round-robin instead of random sharing. Using 3 obviously is

+ 2 - 2
src/map/battle.c

@@ -2317,7 +2317,7 @@ struct Damage battle_calc_magic_attack(
 				sd->ignore_mdef_ele & (1<<tstatus->def_ele) ||
 				sd->ignore_mdef_race & (1<<tstatus->race) ||
 				sd->ignore_mdef_race & (is_boss(target)?1<<RC_BOSS:1<<RC_NONBOSS)
-				))
+			))
 				flag.imdef = 1;
 		}
 
@@ -2348,8 +2348,8 @@ struct Damage battle_calc_magic_attack(
 			ad.damage=battle_attr_fix(src, target, ad.damage, s_ele, tstatus->def_ele, tstatus->ele_lv);
 
 		if (sd && flag.cardfix) {
-			short cardfix=100;
 			short t_class = status_get_class(target);
+			short cardfix=100;
 
 			cardfix=cardfix*(100+sd->magic_addrace[tstatus->race])/100;
 			if (flag.elefix)

+ 3 - 6
src/map/charsave.c

@@ -26,7 +26,6 @@ struct mmo_charstatus *charsave_loadchar(int charid){
 	char *str_p;
 	friends = 0;
 
-//	ShowDebug("charsave_loadchar : charid = %d | hd->master->status.char_id = %d\n", charid) ;
 	c = (struct mmo_charstatus *)aCalloc(1,sizeof(struct mmo_charstatus));
 
          if(charid <= 0){
@@ -36,7 +35,7 @@ struct mmo_charstatus *charsave_loadchar(int charid){
          }
     // add homun_id [albator]
 	//Tested, Mysql 4.1.9+ has no problems with the long query, the buf is 65k big and the sql server needs for it 0.00009 secs on an athlon xp 2400+ WinXP (1GB Mem) ..  [Sirius]
-         sprintf(tmp_sql, "SELECT `char_id`,`account_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`, `str`,`agi`,`vit`,`int`,`dex`,`luk`, `max_hp`,`hp`,`max_sp`,`sp`,`status_point`,`skill_point`, `option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`hair`,`hair_color`, `clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`, `last_map`,`last_x`,`last_y`,`save_map`,`save_x`,`save_y`, `partner_id`, `father`, `mother`, `child`, `fame`, `homun_id` FROM `char` WHERE `char_id` = '%d'", charid);
+		sprintf(tmp_sql, "SELECT `char_id`,`account_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`, `str`,`agi`,`vit`,`int`,`dex`,`luk`, `max_hp`,`hp`,`max_sp`,`sp`,`status_point`,`skill_point`, `option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`hair`,`hair_color`, `clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`, `last_map`,`last_x`,`last_y`,`save_map`,`save_x`,`save_y`, `partner_id`, `father`, `mother`, `child`, `fame`, `homun_id` FROM `char` WHERE `char_id` = '%d'", charid);
     	if(mysql_query(&charsql_handle, tmp_sql)){
 				ShowSQL("DB error - %s\n",mysql_error(&charsql_handle));
 				ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -103,9 +102,9 @@ struct mmo_charstatus *charsave_loadchar(int charid){
          c->mother = atoi(charsql_row[44]);
          c->child = atoi(charsql_row[45]);
          c->fame = atoi(charsql_row[46]);
-		 c->hom_id = atoi(charsql_row[47]); // albator
-        	mysql_free_result(charsql_res);
+			c->hom_id = atoi(charsql_row[47]); // albator
 
+			mysql_free_result(charsql_res);
 
 	//Check for '0' Savepoint / LastPoint
 	if (c->last_point.x == 0 || c->last_point.y == 0 || c->last_point.map == 0){
@@ -240,7 +239,6 @@ struct mmo_charstatus *charsave_loadchar(int charid){
          }
 */
 	
-		 
 	//Shamelessly stolen from its_sparky (ie: thanks) and then assimilated by [Skotlex]
 	//Friend list
 	sprintf(tmp_sql, "SELECT f.friend_account, f.friend_id, c.name FROM friends f LEFT JOIN `char` c ON f.friend_account=c.account_id AND f.friend_id=c.char_id WHERE f.char_id='%d'", charid);
@@ -277,7 +275,6 @@ int charsave_savechar(int charid, struct mmo_charstatus *c){
 //	char tmp_str[64];
 //	char tmp_str2[512];
          //First save the 'char'
-	ShowDebug("charsave_savechar : charid = %d | hd->master->status.char_id = %d\n", charid) ;
 	sprintf(tmp_sql ,"UPDATE `char` SET `class`='%d', `base_level`='%d', `job_level`='%d',"
 		"`base_exp`='%d', `job_exp`='%d', `zeny`='%d',"
 		"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"

+ 1 - 1
src/map/chat.c

@@ -30,7 +30,7 @@ int chat_createchat(struct map_session_data *sd,int limit,int pub,char* pass,cha
 		return 0;	//Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
 
 	if (map[sd->bl.m].flag.nochat) {
-		clif_displaymessage (sd->fd, msg_txt(281));

+		clif_displaymessage (sd->fd, msg_txt(281));
 		return 0; //Can't create chatrooms on this map.
 	}
 	pc_stop_walking(sd,1);

+ 5 - 8
src/map/guild.c

@@ -869,7 +869,6 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
 
 int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 { // cleaned up [LuzZza]
-	
 	struct guild *g;
 	
 	nullpo_retr(0, sd);
@@ -887,18 +886,16 @@ 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(!online){
+		int i=guild_getindex(g,sd->status.account_id,sd->status.char_id);
+		if(i>=0)
+			g->member[i].sd=NULL;
+		return 0;
 	}
 	
 	if(sd->state.guild_sent)
 		return 0;
 
-//	guild_check_conflict(sd); // Check if char belongs to more than one guild? Should be unneeded.
-		
 	clif_guild_belonginfo(sd,g);
 	clif_guild_notice(sd,g);
 	

+ 2 - 2
src/map/mob.c

@@ -1170,13 +1170,13 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
 		(mode&MD_ANGRY && md->state.skillstate == MSS_FOLLOW)
 	) {
 		map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl,
-			view_range, md->special_state.ai?BL_CHAR:BL_PC|BL_HOMUNCULUS, md, &tbl);	//[orn]
+			view_range, md->special_state.ai?BL_CHAR:BL_PC|BL_HOMUNCULUS, md, &tbl);
 		if(!tbl && mode&MD_ANGRY && !md->state.aggressive)
 			md->state.aggressive = 1; //Restore angry state when no targets are visible.
 	} else if (mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW)) {
 		search_size = view_range<md->status.rhw.range ? view_range:md->status.rhw.range;
 		map_foreachinrange (mob_ai_sub_hard_changechase, &md->bl,
-				search_size, (md->special_state.ai?BL_CHAR:BL_PC|BL_HOMUNCULUS), md, &tbl);	//[orn]
+				search_size, (md->special_state.ai?BL_CHAR:BL_PC|BL_HOMUNCULUS), md, &tbl);
 	}
 
 	if (tbl)

+ 8 - 3
src/map/party.c

@@ -469,9 +469,14 @@ int party_optionchanged(int party_id,int account_id,int exp,int item,int flag)
 	if( (p=party_search(party_id))==NULL)
 		return 0;
 
-	if(!(flag&0x01)) p->party.exp=exp;
-	if(!(flag&0x10)) p->party.item=item;
-	clif_party_option(p,sd,flag);
+	if(!(flag&0x01) && p->party.exp != exp) {
+		p->party.exp=exp;
+		clif_party_option(p,sd,flag); //This packet doesn't updates item info anymore...
+	}
+	if(!(flag&0x10) && p->party.item != item) {
+		p->party.item=item;
+		clif_party_main_info(p,-1);
+	}
 	return 0;
 }