summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/int_guild.c4
-rw-r--r--src/char_sql/int_guild.c4
-rw-r--r--src/map/skill.c10
3 files changed, 14 insertions, 4 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index a1f4d418e..6747e43e6 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1417,6 +1417,10 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
(g) ? g->name : "??", gid, (value) ? "occupy" : "abandon", castle_id);
}
gc->guild_id = value;
+ if(gc->guild_id == 0) {
+ //Delete guardians.
+ memset(&gc->guardian, 0, sizeof(gc->guardian));
+ }
break;
case 2: gc->economy = value; break;
case 3: gc->defense = value; break;
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index b3da7ea91..ed30c7031 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -1752,6 +1752,10 @@ int mapif_parse_GuildCastleDataSave(int fd,int castle_id,int index,int value)
(g)?g->name:"??" ,gid, (value)?"occupy":"abandon", castle_id);
}
gc.guild_id = value;
+ if(gc.guild_id == 0) {
+ //Delete guardians.
+ memset(&gc.guardian, 0, sizeof(gc.guardian));
+ }
break;
case 2: gc.economy = value; break;
case 3: gc.defense = value; break;
diff --git a/src/map/skill.c b/src/map/skill.c
index 878436381..1437b2a13 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -821,13 +821,15 @@ int skillnotok(int skillid, struct map_session_data *sd)
// Check skill restrictions [Celest]
if(!map_flag_vs(sd->bl.m) && skill_get_nocast (skillid) & 1)
return 1;
- if(map[sd->bl.m].flag.pvp && skill_get_nocast (skillid) & 2)
+ if(map[sd->bl.m].flag.pvp) {
+ if(!battle_config.pk_mode && skill_get_nocast (skillid) & 2)
+ return 1;
+ if(battle_config.pk_mode && skill_get_nocast (skillid) & 16)
return 1;
+ }
if(map_flag_gvg(sd->bl.m) && skill_get_nocast (skillid) & 4)
return 1;
- if (agit_flag && skill_get_nocast (skillid) & 8)
- return 1;
- if (battle_config.pk_mode && map[sd->bl.m].flag.pvp && skill_get_nocast (skillid) & 16)
+ if(agit_flag && skill_get_nocast (skillid) & 8)
return 1;
if(map[sd->bl.m].flag.restricted && map[sd->bl.m].zone && skill_get_nocast (skillid) & (8*map[sd->bl.m].zone))
return 1;