Fixed bugreport:1017 a item dropping over a ice-wall-occupied cell is no longer lost/deleted.

Dev Note: the thing I added to sign icewalls may be suitable for bugreport:3574 as well

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15772 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-03-23 04:32:38 +00:00
parent ee2653b6eb
commit 1e942e8193
3 changed files with 11 additions and 4 deletions

View File

@ -1346,8 +1346,7 @@ int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data)
* to place an BL_ITEM object. Scan area is 9x9, returns 1 on success. * to place an BL_ITEM object. Scan area is 9x9, returns 1 on success.
* x and y are modified with the target cell when successful. * x and y are modified with the target cell when successful.
*------------------------------------------*/ *------------------------------------------*/
int map_searchrandfreecell(int m,int *x,int *y,int stack) int map_searchrandfreecell(int m,int *x,int *y,int stack) {
{
int free_cell,i,j; int free_cell,i,j;
int free_cells[9][2]; int free_cells[9][2];
@ -1357,7 +1356,7 @@ int map_searchrandfreecell(int m,int *x,int *y,int stack)
for(j=-1;j<=1;j++){ for(j=-1;j<=1;j++){
if(j+*x<0 || j+*x>=map[m].xs) if(j+*x<0 || j+*x>=map[m].xs)
continue; continue;
if(map_getcell(m,j+*x,i+*y,CELL_CHKNOPASS)) if(map_getcell(m,j+*x,i+*y,CELL_CHKNOPASS) && !map_getcell(m,j+*x,i+*y,CELL_CHKICEWALL))
continue; continue;
//Avoid item stacking to prevent against exploits. [Skotlex] //Avoid item stacking to prevent against exploits. [Skotlex]
if(stack && map_count_oncell(m,j+*x,i+*y, BL_ITEM) > stack) if(stack && map_count_oncell(m,j+*x,i+*y, BL_ITEM) > stack)
@ -2515,6 +2514,8 @@ int map_getcellp(struct map_data* m,int x,int y,cell_chk cellchk)
return (cell.nochat); return (cell.nochat);
case CELL_CHKMAELSTROM: case CELL_CHKMAELSTROM:
return (cell.maelstrom); return (cell.maelstrom);
case CELL_CHKICEWALL:
return (cell.icewall);
// special checks // special checks
case CELL_CHKPASS: case CELL_CHKPASS:
@ -2568,6 +2569,7 @@ void map_setcell(int m, int x, int y, cell_t cell, bool flag)
case CELL_NOVENDING: map[m].cell[j].novending = flag; break; case CELL_NOVENDING: map[m].cell[j].novending = flag; break;
case CELL_NOCHAT: map[m].cell[j].nochat = flag; break; case CELL_NOCHAT: map[m].cell[j].nochat = flag; break;
case CELL_MAELSTROM: map[m].cell[j].maelstrom = flag; break; case CELL_MAELSTROM: map[m].cell[j].maelstrom = flag; break;
case CELL_ICEWALL: map[m].cell[j].icewall = flag; break;
default: default:
ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell); ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);
break; break;

View File

@ -401,6 +401,7 @@ typedef enum {
CELL_NOVENDING, CELL_NOVENDING,
CELL_NOCHAT, CELL_NOCHAT,
CELL_MAELSTROM, CELL_MAELSTROM,
CELL_ICEWALL,
} cell_t; } cell_t;
@ -424,6 +425,7 @@ typedef enum {
CELL_CHKNOVENDING, CELL_CHKNOVENDING,
CELL_CHKNOCHAT, CELL_CHKNOCHAT,
CELL_CHKMAELSTROM, CELL_CHKMAELSTROM,
CELL_CHKICEWALL,
} cell_chk; } cell_chk;
@ -442,7 +444,8 @@ struct mapcell
landprotector : 1, landprotector : 1,
novending : 1, novending : 1,
nochat : 1, nochat : 1,
maelstrom : 1; maelstrom : 1,
icewall : 1;
#ifdef CELL_NOSTACK #ifdef CELL_NOSTACK
unsigned char cell_bl; //Holds amount of bls in this cell. unsigned char cell_bl; //Holds amount of bls in this cell.

View File

@ -13216,6 +13216,7 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
case WZ_ICEWALL: case WZ_ICEWALL:
map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,5); 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); clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,5,AREA);
skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,true);
break; break;
case SA_LANDPROTECTOR: case SA_LANDPROTECTOR:
skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,true); skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,true);
@ -13270,6 +13271,7 @@ int skill_delunit (struct skill_unit* unit)
case WZ_ICEWALL: case WZ_ICEWALL:
map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,unit->val2); 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 clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug
skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false);
break; break;
case SA_LANDPROTECTOR: case SA_LANDPROTECTOR:
skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,false); skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,false);