Pārlūkot izejas kodu

- Cleaned up clif_party_info a bit
- Reverted some of my mobdb code

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

ultramage 18 gadi atpakaļ
vecāks
revīzija
cf3421d7f1
6 mainītis faili ar 28 papildinājumiem un 24 dzēšanām
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/atcommand.c
  3. 7 9
      src/map/clif.c
  4. 1 1
      src/map/clif.h
  5. 14 10
      src/map/mob.c
  6. 3 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.
 
 2007/02/15
+	* Reverted some of my mobdb code
+	* Cleaned up clif_party_info a bit
 	* Cleaned up set_reg (the same procedure as get_val) [ultramage]
 	* The default packet version is now 8. Clients from November2006 and before
 	  can no longer get past the char-server unless you change it back to 7.

+ 1 - 1
src/map/atcommand.c

@@ -7671,7 +7671,7 @@ int atcommand_changeleader(const int fd, struct map_session_data* sd, const char
 	intif_party_leaderchange(p->party.party_id,p->party.member[pl_mi].account_id,p->party.member[pl_mi].char_id);
 	//Update info.
 	clif_party_main_info(p,-1);
-	clif_party_info(p,-1);
+	clif_party_info(p,NULL);
 	
 	return 0;  
 }   

+ 7 - 9
src/map/clif.c

@@ -5739,10 +5739,10 @@ int clif_party_join_info(struct party *p, struct map_session_data *sd)
  * Sends party information
  * R 00fb <len>.w <party name>.24B {<ID>.l <nick>.24B <map name>.16B <leader>.B <offline>.B}.46B*
  *------------------------------------------*/
-int clif_party_info(struct party_data* p, int fd)
+int clif_party_info(struct party_data* p, struct map_session_data *sd)
 {
 	unsigned char buf[2+2+NAME_LENGTH+(4+NAME_LENGTH+MAP_NAME_LENGTH+1+1)*MAX_PARTY];
-	struct map_session_data* sd = NULL;
+	struct map_session_data* party_sd = NULL;
 	int i, c;
 
 	nullpo_retr(0, p);
@@ -5754,7 +5754,7 @@ int clif_party_info(struct party_data* p, int fd)
 		struct party_member* m = &p->party.member[i];
 		if(!m->account_id) continue;
 
-		if(sd == NULL) sd = p->data[i].sd; // need at least one member's 'sd' so clif_send() can identify the party
+		if(party_sd == NULL) party_sd = p->data[i].sd;
 
 		WBUFL(buf,28+c*46) = m->account_id;
 		memcpy(WBUFP(buf,28+c*46+4), m->name, NAME_LENGTH);
@@ -5765,12 +5765,10 @@ int clif_party_info(struct party_data* p, int fd)
 	}
 	WBUFW(buf,2) = 28+c*46;
 
-	if(fd >= 0) { // send only to self
-		if (session[fd] && session[fd]->session_data)
-			clif_send(buf, WBUFW(buf,2), &((struct map_session_data *)session[fd]->session_data)->bl, SELF);
-	} else { // send to whole party
-		if(sd)
-			clif_send(buf, WBUFW(buf,2), &sd->bl, PARTY);
+	if(sd) { // send only to self
+		clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+	} else if (party_sd) { // send to whole party
+		clif_send(buf, WBUFW(buf,2), &party_sd->bl, PARTY);
 	}
 	
 	return 0;

+ 1 - 1
src/map/clif.h

@@ -255,7 +255,7 @@ int clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
 int clif_party_created(struct map_session_data *sd,int flag);
 int clif_party_main_info(struct party_data *p, int fd);
 int clif_party_join_info(struct party *p, struct map_session_data *sd);
-int clif_party_info(struct party_data *p,int fd);
+int clif_party_info(struct party_data *p, struct map_session_data *sd);
 int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd);
 int clif_party_inviteack(struct map_session_data *sd,char *nick,int flag);
 int clif_party_option(struct party_data *p,struct map_session_data *sd,int flag);

+ 14 - 10
src/map/mob.c

@@ -3215,9 +3215,8 @@ int mob_parse_dbrow(char** str)
 	memcpy(db->sprite, str[1], NAME_LENGTH-1);
 	memcpy(db->jname, str[2], NAME_LENGTH-1);
 	memcpy(db->name, str[3], NAME_LENGTH-1);
-	
-	db->lv = cap_value(atoi(str[4]), 1, USHRT_MAX);
-	
+	db->lv = atoi(str[4]);
+	db->lv = cap_value(db->lv, 1, USHRT_MAX);
 	status->max_hp = atoi(str[5]);
 	status->max_sp = atoi(str[6]);
 	
@@ -3232,14 +3231,19 @@ int mob_parse_dbrow(char** str)
 	status->rhw.atk2 = atoi(str[11]);
 	status->def = atoi(str[12]);
 	status->mdef = atoi(str[13]);
-	
+	status->str = atoi(str[14]);
+	status->agi = atoi(str[15]);
+	status->vit = atoi(str[16]);
+	status->int_ = atoi(str[17]);
+	status->dex = atoi(str[18]);
+	status->luk = atoi(str[19]);
 	//All status should be min 1 to prevent divisions by zero from some skills. [Skotlex]
-	status->str = cap_value(atoi(str[14]), 1, USHRT_MAX);
-	status->agi = cap_value(atoi(str[15]), 1, USHRT_MAX);
-	status->vit = cap_value(atoi(str[16]), 1, USHRT_MAX);
-	status->int_ = cap_value(atoi(str[17]), 1, USHRT_MAX);
-	status->dex = cap_value(atoi(str[18]), 1, USHRT_MAX);
-	status->luk = cap_value(atoi(str[19]), 1, USHRT_MAX);
+	if (status->str < 1) status->str = 1;
+	if (status->agi < 1) status->agi = 1;
+	if (status->vit < 1) status->vit = 1;
+	if (status->int_< 1) status->int_= 1;
+	if (status->dex < 1) status->dex = 1;
+	if (status->luk < 1) status->luk = 1;
 	
 	db->range2 = atoi(str[20]);
 	db->range3 = atoi(str[21]);

+ 3 - 3
src/map/party.c

@@ -244,7 +244,7 @@ int party_recv_info(struct party *sp)
 			continue;
 		clif_party_main_info(p,-1);
 		clif_party_option(p,sd,0x100);
-		clif_party_info(p,-1);
+		clif_party_info(p,NULL);
 		sd->state.party_sent=1;
 	}
 	
@@ -504,7 +504,7 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m
 		return 0;
 	}
 	
-	clif_party_info(p,-1);
+	clif_party_info(p,NULL);
 	return 0;
 }
 
@@ -540,7 +540,7 @@ void party_send_movemap(struct map_session_data *sd)
 		if(sd->status.party_id==p->party.party_id){
 			clif_party_main_info(p,sd->fd);
 			clif_party_option(p,sd,0x100);
-			clif_party_info(p,sd->fd);
+			clif_party_info(p,sd);
 			sd->state.party_sent=1;
 		}
 	}