فهرست منبع

Fixed OnPCLoginEvent not working correctly (bugreport:1182).
Cleaned up some code typos/engrish.

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

ultramage 17 سال پیش
والد
کامیت
27f2a37fc4
5فایلهای تغییر یافته به همراه21 افزوده شده و 16 حذف شده
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/atcommand.c
  3. 11 10
      src/map/clif.c
  4. 1 1
      src/map/mob.c
  5. 7 4
      src/map/pc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ 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.
 
 2008/03/18
+	* Fixed OnPCLoginEvent not working correctly (bugreport:1182) [ultramage]
 	* Added missing WorkingDirectory value to vcproj-7.1, vcproj-8 projects.
 	  Now you can flawlessly run your compiled server with RUN button in
 	  the correct directory. Thanks to Konrad [Lupus]

+ 1 - 1
src/map/atcommand.c

@@ -7834,7 +7834,7 @@ int atcommand_barricade(const int fd, struct map_session_data* sd, const char* c
 	case 1: clif_displaymessage(fd, "Barricade fail. Invalid Size"); break;
 	case 2: clif_displaymessage(fd, "Barricade fail. Wall problem."); break;
 	case 3: clif_displaymessage(fd, "Barricade fail. Invalid Event"); break;
-	case 4: clif_displaymessage(fd, "Barricade fail. Event allready exists"); break;
+	case 4: clif_displaymessage(fd, "Barricade fail. Event already exists"); break;
 	}
 
 	return -1;

+ 11 - 10
src/map/clif.c

@@ -7936,17 +7936,23 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 		npc_script_event(sd, NPCE_LOGIN);
 		mob_barricade_get(sd);
 	} else {
-		//For some reason the client "loses" these on map-change.
+		//For some reason the client "loses" these on warp/map-change.
 		clif_updatestatus(sd,SP_STR);
 		clif_updatestatus(sd,SP_AGI);
 		clif_updatestatus(sd,SP_VIT);
 		clif_updatestatus(sd,SP_INT);
 		clif_updatestatus(sd,SP_DEX);
 		clif_updatestatus(sd,SP_LUK);
+	
+		// abort currently running script
+		sd->state.using_fake_npc = 0;
+
+		if(sd->npc_id)
+			npc_event_dequeue(sd);
 	}
 
 	if( sd->state.changemap )
-	{
+	{// restore information that gets lost on map-change
 		if (night_flag && map[sd->bl.m].flag.nightenabled)
 		{	//Display night.
 			if( !sd->state.night )
@@ -7965,11 +7971,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 		sd->state.changemap = false;
 	}
 	
-	sd->state.using_fake_npc = 0;
-
-	if(sd->npc_id)
-		npc_event_dequeue(sd);
-
 #ifndef TXT_ONLY
 		mail_clear(sd);
 #endif
@@ -12023,9 +12024,9 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
  * Adoption System
  *==========================================*/
 
-// 0 : You cannot adopt more that 1 son
-// 1 : You should be at least lvl 70 to adopt
-// 2 : You cannot adopt a married player
+// 0 : "You cannot adopt more than 1 child."
+// 1 : "You must be at least character level 70 in order to adopt someone."
+// 2 : "You cannot adopt a married person."
 void clif_Adopt_reply(struct map_session_data *sd, int type)
 {
 	int fd = sd->fd;

+ 1 - 1
src/map/mob.c

@@ -513,7 +513,7 @@ short mob_barricade_build(short m, short x, short y, short count, short dir, boo
 		return 2;
 
 	if( (barricade = (struct barricade_data *)strdb_get(barricade_db,event)) != NULL )
-		return 3; // Allready a barricade with event name
+		return 3; // Already a barricade with event name
 
 	if( map_getcell(m, x, y, CELL_CHKNOREACH) )
 		return 4; // Starting cell problem

+ 7 - 4
src/map/pc.c

@@ -569,7 +569,7 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
 		return false;
 
 	if( b_sd->status.father || b_sd->status.mother || b_sd->adopt_invite )
-		return false; // allready adopted baby / in adopt request
+		return false; // already adopted baby / in adopt request
 
 	if( !p1_sd->status.partner_id || !p1_sd->status.party_id || p1_sd->status.party_id != b_sd->status.party_id )
 		return false; // You need to be married and in party with baby to adopt
@@ -587,13 +587,13 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
 	if( !pc_isequipped(p2_sd, WEDDING_RING_M) && !pc_isequipped(p2_sd, WEDDING_RING_F) )
 		return false;
 
-	// Allready adopted a baby
+	// Already adopted a baby
 	if( p1_sd->status.child || p2_sd->status.child ) {
 		clif_Adopt_reply(p1_sd, 0);
 		return false;
 	}
 
-	// Fathers need at least lvl 70 to adopt
+	// Parents need at least lvl 70 to adopt
 	if( p1_sd->status.base_level < 70 || p2_sd->status.base_level < 70 ) {
 		clif_Adopt_reply(p1_sd, 1);
 		return false;
@@ -604,7 +604,10 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
 		return false;
 	}
 
-	return ( b_sd->status.class_ >= JOB_NOVICE && b_sd->status.class_ <= JOB_THIEF );
+	if( !(b_sd->status.class_ >= JOB_NOVICE && b_sd->status.class_ <= JOB_THIEF) )
+		return false;
+
+	return true;
 }
 
 /*==========================================