Bladeren bron

- Made the pc reg variables receive a const char* as the argument, since they duplicate the value anyway (and they were receiving const char* values from the setd function)
- Fixed Wand of Hermod not starting the SC_HERMOD status change (which blocks spells)
- Fixed a missing break in the cast cancel code.
- Fixed additional def/mdef from vit/int bonuses being lost when a status change that affects def/mdef triggers (for homunculus)


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

skotlex 17 jaren geleden
bovenliggende
commit
9a2033c364
7 gewijzigde bestanden met toevoegingen van 14 en 11 verwijderingen
  1. 4 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/pc.c
  3. 2 2
      src/map/pc.h
  4. 2 2
      src/map/script.c
  5. 0 1
      src/map/skill.c
  6. 3 3
      src/map/status.c
  7. 1 1
      src/map/unit.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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/01/08
+	* Fixed Wand of Hermod not starting the SC_HERMOD status change (which
+	  blocks spells)
+	* Fixed additional def/mdef from vit/int bonuses being lost when a status
+	  change that affects def/mdef triggers (for homunculus) [Skotlex]
 	* Added missing code to log main chat messages sent by whispering
 	  to main_chat_nick (bugreport:424) [ultramage]
 2008/01/07

+ 2 - 2
src/map/pc.c

@@ -5930,7 +5930,7 @@ char* pc_readregstr(struct map_session_data* sd, int reg)
 /*==========================================
  * script—p•¶Žš—ñ??‚Ì’l‚ð�Ý’è
  *------------------------------------------*/
-int pc_setregstr(struct map_session_data* sd, int reg, char* str)
+int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
 {
 	int i;
 
@@ -6113,7 +6113,7 @@ int pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type)
 	return 0;
 }
 
-int pc_setregistry_str(struct map_session_data *sd,char *reg,char *val,int type)
+int pc_setregistry_str(struct map_session_data *sd,char *reg,const char *val,int type)
 {
 	struct global_reg *sd_reg;
 	int i,*max, regmax;

+ 2 - 2
src/map/pc.h

@@ -245,7 +245,7 @@ int pc_setparam(struct map_session_data*,int,int);
 int pc_readreg(struct map_session_data*,int);
 int pc_setreg(struct map_session_data*,int,int);
 char *pc_readregstr(struct map_session_data *sd,int reg);
-int pc_setregstr(struct map_session_data *sd,int reg,char *str);
+int pc_setregstr(struct map_session_data *sd,int reg,const char *str);
 
 #define pc_readglobalreg(sd,reg) pc_readregistry(sd,reg,3)
 #define pc_setglobalreg(sd,reg,val) pc_setregistry(sd,reg,val,3)
@@ -262,7 +262,7 @@ int pc_setregstr(struct map_session_data *sd,int reg,char *str);
 int pc_readregistry(struct map_session_data*,const char*,int);
 int pc_setregistry(struct map_session_data*,const char*,int,int);
 char *pc_readregistry_str(struct map_session_data*,char*,int);
-int pc_setregistry_str(struct map_session_data*,char*,char*,int);
+int pc_setregistry_str(struct map_session_data*,char*,const char*,int);
 
 int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name);
 int pc_deleventtimer(struct map_session_data *sd,const char *name);

+ 2 - 2
src/map/script.c

@@ -2250,13 +2250,13 @@ void* get_val2(struct script_state* st, int uid, struct linkdb_node** ref)
  * Stores the value of a script variable
  * Return value is 0 on fail, 1 on success.
  *------------------------------------------*/
-static int set_reg(struct script_state* st, TBL_PC* sd, int num, char* name, void* value, struct linkdb_node** ref)
+static int set_reg(struct script_state* st, TBL_PC* sd, int num, char* name, const void* value, struct linkdb_node** ref)
 {
 	char prefix = name[0]; char postfix = name[strlen(name)-1];
 
 	if (postfix == '$') { // string variable
 
-		char* str = (char*)value;
+		const char* str = (const char*)value;
 		switch (prefix) {
 		case '@':
 			return pc_setregstr(sd, num, str);

+ 0 - 1
src/map/skill.c

@@ -6545,7 +6545,6 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
 	case UNT_HERMODE:
 		if (sg->src_id!=bl->id && battle_check_target(&src->bl,bl,BCT_PARTY|BCT_GUILD) > 0)
 			status_change_clear_buffs(bl,1); //Should dispell only allies.
-			break;
 	case UNT_RICHMANKIM:
 	case UNT_ETERNALCHAOS:
 	case UNT_DRUMBATTLEFIELD:

+ 3 - 3
src/map/status.c

@@ -2864,13 +2864,13 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag)	//[orn]
 		if(status->sp > status->max_sp)
 			status->sp = status->max_sp;
 	}
-	if(flag&SCB_VIT)
+	if(flag&(SCB_VIT|SCB_DEF))
 	{	//Since vit affects def, recalculate def.
 		flag|=SCB_DEF;
 		status->def = status_calc_def(&hd->bl, &hd->sc, b_status->def);
-		status->def+=	(status->vit/5 - b_status->vit/5);
+		status->def+=(status->vit/5 - b_status->vit/5);
 	}
-	if(flag&SCB_INT)
+	if(flag&(SCB_INT|SCB_MDEF))
 	{
 		flag|=SCB_MDEF;
 		status->mdef = status_calc_mdef(&hd->bl, &hd->sc, b_status->mdef);

+ 1 - 1
src/map/unit.c

@@ -878,8 +878,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
 			if(ud->skillid != skill_num){
 				sd->skillid_old = ud->skillid;
 				sd->skilllv_old = ud->skilllv;
-				break;
 			}
+			break;
 		case BD_ENCORE:
 			//Prevent using the dance skill if you no longer have the skill in your tree. 
 			if(!sd->skillid_dance || pc_checkskill(sd,sd->skillid_dance)<=0){