Browse Source

Update

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@745 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 years ago
parent
commit
092e907286
4 changed files with 15 additions and 2 deletions
  1. 5 2
      Changelog.txt
  2. 1 0
      src/map/map.h
  3. 2 0
      src/map/party.c
  4. 7 0
      src/map/pc.c

+ 5 - 2
Changelog.txt

@@ -1,7 +1,10 @@
 Date	Added
 Date	Added
 12/22
 12/22
-	* Fixed a bug in resnametable from local directories [MouseJstr]
-	* Fixed a bug in grfio_read causing memory corruptions [MouseJstr]
+	* Changed how party exp is passed out to eliminate players
+	  current in a chat window or those who havn't moved or attacked
+	  in 2 minutes [MouseJstr]
+	* Fixed a bug in resnametable from local directories,
+	  by fixing a bug in grfio_read causing memory corruptions [MouseJstr]
         * Rearranged how guild messages, gm messages, and party messages
         * Rearranged how guild messages, gm messages, and party messages
           are moved back and forth between the inter server and the
           are moved back and forth between the inter server and the
           map server.. eliminating unneeded round trips to eliminate
           map server.. eliminating unneeded round trips to eliminate

+ 1 - 0
src/map/map.h

@@ -185,6 +185,7 @@ struct map_session_data {
 	char *npc_stackbuf;
 	char *npc_stackbuf;
 	char npc_str[256];
 	char npc_str[256];
 	unsigned int chatID;
 	unsigned int chatID;
+	unsigned long idletime;
 
 
 	struct{
 	struct{
 		char name[24];
 		char name[24];

+ 2 - 0
src/map/party.c

@@ -591,6 +591,8 @@ int party_exp_share(struct party *p,int map,int base_exp,int job_exp,int zeny)
 		return 0;
 		return 0;
 	for(i=0;i<MAX_PARTY;i++)
 	for(i=0;i<MAX_PARTY;i++)
 		if((sd=p->member[i].sd)!=NULL && sd->bl.m==map && session[sd->fd] != NULL) {
 		if((sd=p->member[i].sd)!=NULL && sd->bl.m==map && session[sd->fd] != NULL) {
+			if (/* pc_issit(sd) || */ (sd->chatID != NULL) || (sd->idletime < (time(0) - 120)))
+				continue;
 #ifdef TWILIGHT
 #ifdef TWILIGHT
 			pc_gainexp(sd,base_exp,job_exp);
 			pc_gainexp(sd,base_exp,job_exp);
 #else
 #else

+ 7 - 0
src/map/pc.c

@@ -4311,6 +4311,7 @@ int pc_walktoxy(struct map_session_data *sd,int x,int y)
 
 
 	sd->to_x=x;
 	sd->to_x=x;
 	sd->to_y=y;
 	sd->to_y=y;
+	sd->idletime = time(0);
 
 
 	if(sd->walktimer != -1 && sd->state.change_walk_target==0){
 	if(sd->walktimer != -1 && sd->state.change_walk_target==0){
 		// 現在?いている最中の目的地?更なのでマス目の中心に?た暫ノ
 		// 現在?いている最中の目的地?更なのでマス目の中心に?た暫ノ
@@ -4643,6 +4644,9 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
 	sd=map_id2sd(id);
 	sd=map_id2sd(id);
 	if(sd == NULL)
 	if(sd == NULL)
 		return 0;
 		return 0;
+
+	sd->idletime = time(0);
+
 	if(sd->attacktimer != tid){
 	if(sd->attacktimer != tid){
 		if(battle_config.error_log)
 		if(battle_config.error_log)
 			printf("pc_attack_timer %d != %d\n",sd->attacktimer,tid);
 			printf("pc_attack_timer %d != %d\n",sd->attacktimer,tid);
@@ -4755,11 +4759,14 @@ int pc_attack(struct map_session_data *sd,int target_id,int type)
 	struct block_list *bl;
 	struct block_list *bl;
 	int d;
 	int d;
 
 
+
 	nullpo_retr(0, sd);
 	nullpo_retr(0, sd);
 
 
 	bl=map_id2bl(target_id);
 	bl=map_id2bl(target_id);
 	if(bl==NULL)
 	if(bl==NULL)
 		return 1;
 		return 1;
+
+	sd->idletime = time(0);
 	
 	
 	if(bl->type==BL_NPC) { // monster npcs [Valaris]
 	if(bl->type==BL_NPC) { // monster npcs [Valaris]
 		//npc_click(sd,RFIFOL(sd->fd,2));
 		//npc_click(sd,RFIFOL(sd->fd,2));