summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-06-29 15:16:51 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-06-29 15:16:51 +0000
commit386b2af17167e5dafcbbc892dba2866c22b0934b (patch)
treee0285c471d73eec77bfed84bcf3ec61d6ea643d2 /src/map/mob.c
parentbf559662f0d0c0d9cbdd3c3f65990b6032472e33 (diff)
downloadhercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.gz
hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.bz2
hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.xz
hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.zip
- Added support to Cash Shop for script command callshop
- Fixed a bug in OnTouchNPC - Cleanup in barricade code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12896 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index adc8d8c83..5ff325ad1 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -545,8 +545,12 @@ short mob_barricade_build(short m, short x, short y, const char* mobname, short
safestrncpy(barricade->npc_event, event, sizeof(barricade->npc_event));
barricade->amount = 0;
barricade->killable = killable;
- barricade->shootable = shootable;
- barricade->walkable = walkable;
+
+ // A protection just in case setting a walkable - non shootable
+ if( (barricade->walkable = walkable) == true )
+ barricade->shootable = true;
+ else
+ barricade->shootable = shootable;
for( i = 0; i < count; i++ )
{
@@ -567,8 +571,11 @@ short mob_barricade_build(short m, short x, short y, const char* mobname, short
md->barricade = barricade;
}
- if( !barricade->walkable ) map_setcell(m, x1, y1, CELL_WALKABLE, false);
- map_setcell(m, x1, y1, CELL_SHOOTABLE, barricade->shootable);
+ if( !barricade->walkable )
+ {
+ map_setcell(m, x1, y1, CELL_WALKABLE, false);
+ map_setcell(m, x1, y1, CELL_SHOOTABLE, barricade->shootable);
+ }
clif_changemapcell(0, m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
@@ -623,8 +630,11 @@ static void mob_barricade_break(struct barricade_data *barricade, struct block_l
{
mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
- if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
- map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
+ if( !barricade->shootable )
+ map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, true);
+ if( !barricade->walkable )
+ map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+
clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
@@ -685,8 +695,11 @@ void mod_barricade_clearall(void)
{
mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
- if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
- map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
+ if( !barricade->shootable )
+ map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, true);
+ if( !barricade->walkable )
+ map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+
clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
}