Browse Source

Moved the new novending cell check from the internal code to the client-server interface (allows server to force-open shop if needed)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11580 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 17 years ago
parent
commit
e3ab4cdcfe
6 changed files with 8 additions and 12 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/clif.c
  3. 2 2
      src/map/pc.c
  4. 1 1
      src/map/pc.h
  5. 1 1
      src/map/status.c
  6. 0 6
      src/map/vending.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/10/26
+	* Moved the new novending cell check from the internal code to the
+	  client-server interface (allows server to force-open shop if needed)
 	* Removed confusing map_nick2sd_nocase(), let the charserver handle it
 	* Added correct packet for attachment retrieval failure when overweight
 	* Fixed one more mistake in r11571 (Sql->SqlStmt) [ultramage]

+ 2 - 2
src/map/clif.c

@@ -10023,9 +10023,9 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd)
 	bool flag = (bool)RFIFOB(fd,84);
 	const uint8* data = (uint8*)RFIFOP(fd,85);
 
-	if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
+	if( sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM )
 		return;
-	if (map[sd->bl.m].flag.novending) {
+	if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) ) {
 		clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open shop on this map"
 		return;
 	}

+ 2 - 2
src/map/pc.c

@@ -943,7 +943,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
 			ShowError("pc_calc_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
 		return 1;
 	}
-	c = pc_class2idx(c);	
+	c = pc_class2idx(c);
 	for(i=0;i<MAX_SKILL;i++){ 
 		if (sd->status.skill[i].flag != 13) //Don't touch plagiarized skills
 			sd->status.skill[i].id=0; //First clear skills.
@@ -1063,7 +1063,7 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill)
 			ShowError("pc_check_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
 		return;
 	}
-	c = pc_class2idx(c);	
+	c = pc_class2idx(c);
 	do {
 		flag=0;
 		for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[c][i].id)>0;i++){

+ 1 - 1
src/map/pc.h

@@ -7,7 +7,7 @@
 #include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus
 #include "../common/timer.h" // INVALID_TIMER
 #include "battle.h" // battle_config
-#include "map.h" // struct map_session_data
+#include "map.h" // JOB_*, struct map_session_data
 #include "status.h" // OPTION_*
 #include "unit.h" // unit_stop_attack(), unit_stop_walking()
 

+ 1 - 1
src/map/status.c

@@ -586,7 +586,7 @@ int status_set_sp(struct block_list *bl, unsigned int sp, int flag)
 
 int status_charge(struct block_list* bl, int hp, int sp)
 {
-	if(!((bl)->type&BL_CONSUME))
+	if(!(bl->type&BL_CONSUME))
 		return hp+sp; //Assume all was charged so there are no 'not enough' fails.
 	return status_damage(NULL, bl, hp, sp, 0, 3);
 }

+ 0 - 6
src/map/vending.c

@@ -237,12 +237,6 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
 		return;
 	}
 	
-	if ( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) )
-	{
-		clif_displaymessage (sd->fd, msg_txt(276));
-		return; //Can't vend in novending mapflag maps.
-	}
-
 	// check number of items in shop
 	if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl )
 	{	// invalid item count