Ver Fonte

* Removed NODAMAGE and ICEWALL cell types (mem usage back to normal)
- Icewall now uses basic cell type 5 (nonwalkable, shootable)
- as a consequence, you can now warp to a nonwalkable cell - but only via gm command or scripted warp bug (hopefully :)

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

ultramage há 17 anos atrás
pai
commit
1acd00e838
6 ficheiros alterados com 36 adições e 76 exclusões
  1. 4 0
      Changelog-Trunk.txt
  2. 0 3
      src/map/battle.c
  3. 2 8
      src/map/map.c
  4. 0 6
      src/map/map.h
  5. 8 12
      src/map/pc.c
  6. 22 47
      src/map/skill.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/02/27
+	* Removed NODAMAGE and ICEWALL cell types (mem usage back to normal)
+	- Icewall now uses basic cell type 5 (nonwalkable, shootable)
+	- as a consequence, you can now warp to a nonwalkable cell - but only
+	  via gm command or scripted warp bug (hopefully :)
 	* Added missing option changes for Illusionary Shadow and Soul Link
 	  that disappeared when you left the screen (bugreport:1053)
 	* Added support for the "view player equip" feature (see topic:174461)

+ 0 - 3
src/map/battle.c

@@ -3023,9 +3023,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 			return -1;
 	}
 
-	if (flag&BCT_ENEMY && (map_getcell(m,src->x,src->y,CELL_CHKNODAMAGE) || map_getcell(m,target->x,target->y,CELL_CHKNODAMAGE)))
-		return -1; // [NoDamage]
-
 	//t_bl/s_bl hold the 'master' of the attack, while src/target are the actual
 	//objects involved.
 	if ((t_bl = battle_get_master(target)) == NULL)

+ 2 - 8
src/map/map.c

@@ -2272,12 +2272,8 @@ int map_getcellp(struct map_data* m,int x,int y,cell_chk cellchk)
 			return (cell.basilica);
 		case CELL_CHKLANDPROTECTOR:
 			return (cell.landprotector);
-		case CELL_CHKICEWALL:
-			return (cell.icewall);
 		case CELL_CHKNOVENDING:
 			return (cell.novending);
-		case CELL_CHKNODAMAGE:
-			return (cell.nodamage);
 		case CELL_CHKNOCHAT:
 			return (cell.nochat);
 
@@ -2287,14 +2283,14 @@ int map_getcellp(struct map_data* m,int x,int y,cell_chk cellchk)
 			if (cell.cell_bl >= battle_config.cell_stack_limit) return 0;
 #endif
 		case CELL_CHKREACH:
-			return (cell.walkable && !cell.icewall);
+			return (cell.walkable);
 
 		case CELL_CHKNOPASS:
 #ifdef CELL_NOSTACK
 			if (cell.cell_bl >= battle_config.cell_stack_limit) return 1;
 #endif
 		case CELL_CHKNOREACH:
-			return (!cell.walkable || cell.icewall);
+			return (!cell.walkable);
 
 		case CELL_CHKSTACK:
 #ifdef CELL_NOSTACK
@@ -2328,11 +2324,9 @@ void map_setcell(int m, int x, int y, cell_t cell, bool flag)
 		case CELL_WATER:         map[m].cell[j].water = flag;         break;
 
 		case CELL_NPC:           map[m].cell[j].npc = flag;           break;
-		case CELL_ICEWALL:       map[m].cell[j].icewall = flag;       break;
 		case CELL_BASILICA:      map[m].cell[j].basilica = flag;      break;
 		case CELL_LANDPROTECTOR: map[m].cell[j].landprotector = flag; break;
 		case CELL_NOVENDING:     map[m].cell[j].novending = flag;     break;
-		case CELL_NODAMAGE:      map[m].cell[j].nodamage = flag;      break;
 		case CELL_NOCHAT:        map[m].cell[j].nochat = flag;        break;
 		default:
 			ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);

+ 0 - 6
src/map/map.h

@@ -1104,9 +1104,7 @@ typedef enum {
 	CELL_NPC,
 	CELL_BASILICA,
 	CELL_LANDPROTECTOR,
-	CELL_ICEWALL,
 	CELL_NOVENDING,
-	CELL_NODAMAGE,
 	CELL_NOCHAT,
 } cell_t;
 
@@ -1127,9 +1125,7 @@ typedef enum {
 	CELL_CHKNPC,
 	CELL_CHKBASILICA,
 	CELL_CHKLANDPROTECTOR,
-	CELL_CHKICEWALL,
 	CELL_CHKNOVENDING,
-	CELL_CHKNODAMAGE,
 	CELL_CHKNOCHAT,
 } cell_chk;
 
@@ -1146,9 +1142,7 @@ struct mapcell
 		npc : 1,
 		landprotector : 1,
 		basilica : 1,
-		icewall : 1,
 		novending : 1,
-		nodamage : 1,
 		nochat : 1;
 
 #ifdef CELL_NOSTACK

+ 8 - 12
src/map/pc.c

@@ -3426,18 +3426,14 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
 		return 0;
 	}
 
-	if(x <0 || x >= map[m].xs || y <0 || y >= map[m].ys)
-		x=y=0;
-	if((x==0 && y==0) ||
-		(map_getcell(m, x, y, CELL_CHKNOPASS) &&
-#ifdef CELL_NOSTACK
-		!map_getcell(m, x, y, CELL_CHKSTACK) &&
-#endif
-		!map_getcell(m, x, y, CELL_CHKICEWALL))
-	){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex]
-		if(x||y) {
-			ShowError("pc_setpos: attempt to place player %s (%d:%d) on non-walkable tile (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
-		}
+	if( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys )
+	{
+		ShowError("pc_setpos: attempt to place player %s (%d:%d) on invalid coordinates (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
+		x = y = 0; // make it random
+	}
+
+	if( x == 0 && y == 0 )
+	{// pick a random walkable cell
 		do {
 			x=rand()%(map[m].xs-2)+1;
 			y=rand()%(map[m].ys-2)+1;

+ 22 - 47
src/map/skill.c

@@ -6427,18 +6427,14 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
 		if(range<=0)
 			map_foreachincell(skill_cell_overlap,src->m,ux,uy,BL_SKILL,skillid,&alive, src);
 		
-		if(alive && map_getcell(src->m,ux,uy,CELL_CHKWALL))
+		if( alive && map_getcell(src->m,ux,uy,CELL_CHKWALL) )
 			alive = 0;
 		
 		if( alive && battle_config.skill_wall_check && !path_search_long(NULL,src->m,ux,uy,x,y,CELL_CHKWALL) )
 			alive = 0; //no path between cell and center of casting.
 					
-		if(alive && skillid == WZ_ICEWALL) {
-				if( map_getcell(src->m,ux,uy,CELL_CHKWALL) || map_getcell(src->m,ux,uy,CELL_CHKCLIFF) )
-					alive=0;
-				else
-					clif_changemapcell(0,src->m,ux,uy,5,AREA);
-		}
+		if( alive && skillid == WZ_ICEWALL && !map_getcell(src->m,ux,uy,CELL_CHKREACH) )
+			alive = 0;
 
 		if(alive){
 			//FIXME: why not calculate val1/val2 in here? [ultramage]
@@ -7249,37 +7245,6 @@ int skill_unit_effect (struct block_list* bl, va_list ap)
 	return 0;
 }
 
-/*==========================================
- * Triggers when a skill unit is about to be deleted
- *------------------------------------------*/
-static int skill_unit_ondelete (struct skill_unit *src, unsigned int tick)
-{
-	struct skill_unit_group *sg;
-	nullpo_retr(0, src);
-	nullpo_retr(0, sg=src->group);
-
-	switch( sg->unit_id )
-	{
-
-	case UNT_ICEWALL:
-		// hack to prevent client from leaving cells unwalkable
-		//FIXME: this should be done individually in insight/outsight code instead [ultramage]
-		clif_changemapcell(0,src->bl.m,src->bl.x,src->bl.y,src->val2,ALL_SAMEMAP);
-	break;
-
-	case UNT_ANKLESNARE:
-	{
-		struct block_list *target = map_id2bl(sg->val2);
-		if(target)
-			status_change_end(target,SC_ANKLE,-1);
-	}
-	break;
-
-	}
-
-	return 0;
-}
-
 /*==========================================
  *
  *------------------------------------------*/
@@ -9249,22 +9214,26 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
 
 	map_addblock(&unit->bl);
 
+	// perform oninit actions
 	switch (group->skill_id) {
+	case WZ_ICEWALL:
+		map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,5);
+		clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,5,AREA);
+		break;
 	case SA_LANDPROTECTOR:
 		skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,true);
 		break;
 	case HP_BASILICA:
 		skill_unitsetmapcell(unit,HP_BASILICA,group->skill_lv,CELL_BASILICA,true);
 		break;
-	case WZ_ICEWALL:
-		skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,true);
-		break;
 	default:
 		if (group->state.song_dance&0x1) //Check for dissonance.
 			skill_dance_overlap(unit, 1);
 		break;
 	}
+
 	clif_skill_setunit(unit);
+
 	return unit;
 }
 
@@ -9280,9 +9249,6 @@ int skill_delunit (struct skill_unit* unit)
 		return 0;
 	nullpo_retr(0, group=unit->group);
 
-	// invoke ondelete event
-	skill_unit_ondelete(unit, gettick());
-
 	if( group->state.song_dance&0x1 ) //Cancel dissonance effect.
 		skill_dance_overlap(unit, 0);
 
@@ -9290,16 +9256,25 @@ int skill_delunit (struct skill_unit* unit)
 	if( !unit->range )
 		map_foreachincell(skill_unit_effect,unit->bl.m,unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),4);
 
+	// perform ondelete actions
 	switch (group->skill_id) {
+	case HT_ANKLESNARE:
+		{
+		struct block_list* target = map_id2bl(group->val2);
+		if( target )
+			status_change_end(target,SC_ANKLE,-1);
+		}
+		break;
+	case WZ_ICEWALL:
+		map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,unit->val2);
+		clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug
+		break;
 	case SA_LANDPROTECTOR:
 		skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,false);
 		break;
 	case HP_BASILICA:
 		skill_unitsetmapcell(unit,HP_BASILICA,group->skill_lv,CELL_BASILICA,false);
 		break;
-	case WZ_ICEWALL:
-		skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false);
-		break;
 	}
 
 	clif_skill_delunit(unit);