summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-08 16:05:20 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-08 16:05:20 +0000
commit24f1e9e8b1865f47475d32214bcaa039a79a5df2 (patch)
treec63d5930dd96beed7f79674284f3b022bc3ef745 /src/map
parent80de35a12f4da3003c7e4c8f63bbc72b075baa0f (diff)
downloadhercules-24f1e9e8b1865f47475d32214bcaa039a79a5df2.tar.gz
hercules-24f1e9e8b1865f47475d32214bcaa039a79a5df2.tar.bz2
hercules-24f1e9e8b1865f47475d32214bcaa039a79a5df2.tar.xz
hercules-24f1e9e8b1865f47475d32214bcaa039a79a5df2.zip
- Updated some Guild WoE rules to behave as explained here: http://www.eathena.ws/board/index.php?showtopic=146581
- Removed the nosave mapflags from the Guild Castles, as per the previously linked topic. - Added some missing map_freeblock_lock calls to castend_pos and castend_id functions to prevent (rather unlikely) dangling pointer crashes. - Improved the debug message when the npc_scriptcont npc IDs don't match. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10187 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/guild.c11
-rw-r--r--src/map/npc.c7
-rw-r--r--src/map/skill.c6
3 files changed, 12 insertions, 12 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 8399022e3..6b7dcbf65 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -650,7 +650,7 @@ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd)
}
if(tsd->status.guild_id>0 ||
tsd->guild_invite>0 ||
- map[tsd->bl.m].flag.gvg_castle)
+ (agit_flag && map[tsd->bl.m].flag.gvg_castle))
{ //Can't invite people inside castles. [Skotlex]
clif_guild_inviteack(sd,0);
return 0;
@@ -784,7 +784,7 @@ int guild_leave(struct map_session_data *sd,int guild_id,
if(sd->status.account_id!=account_id ||
sd->status.char_id!=char_id || sd->status.guild_id!=guild_id ||
- map[sd->bl.m].flag.gvg_castle) //Can't leave inside guild castles.
+ (agit_flag && map[sd->bl.m].flag.gvg_castle))
return 0;
intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes);
@@ -814,7 +814,7 @@ int guild_expulsion(struct map_session_data *sd,int guild_id,
//Can't leave inside guild castles.
if ((tsd = map_id2sd(account_id)) &&
tsd->status.char_id == char_id &&
- map[tsd->bl.m].flag.gvg_castle)
+ (agit_flag && map[tsd->bl.m].flag.gvg_castle))
return 0;
for(i=0;i<g->max_member;i++){ // 所属しているか
@@ -1407,11 +1407,6 @@ int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
return 0;
}
- if(agit_flag) {
- clif_displaymessage(sd->fd,"You cannot make oppositions during Guild Wars!");
- return 0;
- }
-
for(i=0;i<MAX_GUILDALLIANCE;i++){ // すでに関係を持っているか確認
if(g->alliance[i].guild_id==tsd->status.guild_id){
if(g->alliance[i].opposition==1){ // すでに敵対
diff --git a/src/map/npc.c b/src/map/npc.c
index 9d12fa2d6..faee6fc10 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1206,10 +1206,9 @@ int npc_scriptcont(struct map_session_data *sd,int id)
if( id != sd->npc_id ){
TBL_NPC* nd_sd=(TBL_NPC*)map_id2bl(sd->npc_id);
TBL_NPC* nd=(TBL_NPC*)map_id2bl(id);
- if( nd_sd && nd )
- ShowWarning("npc_scriptcont: %s (sd->npc_id=%d) is not %s (id=%d).\n", nd_sd->name, sd->npc_id, nd->name, id);
- else
- ShowDebug("npc_scriptcont: Invalid npc ID, npc_id variable not cleared? %x (sd->npc_id=%d) is not %x (id=%d)\n", (int)nd_sd, sd->npc_id, (int)nd, id);
+ ShowDebug("npc_scriptcont: %s (sd->npc_id=%d) is not %s (id=%d).\n",
+ nd_sd?nd_sd->name:"'Unknown NPC'", sd->npc_id,
+ nd?nd->name:"'Unknown NPC'", id);
return 1;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 0bd3f288e..0cf04bbe6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5720,6 +5720,8 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
if(battle_config.skill_log && battle_config.skill_log&src->type)
ShowInfo("Type %d, ID %d skill castend id [id =%d, lv=%d, target ID %d)\n",
src->type, src->id, ud->skillid, ud->skilllv, target->id);
+
+ map_freeblock_lock();
if (skill_get_casttype(ud->skillid) == CAST_NODAMAGE)
skill_castend_nodamage_id(src,target,ud->skillid,ud->skilllv,tick,0);
else
@@ -5734,6 +5736,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
else ud->skillid = 0; //mobs can't clear this one as it is used for skill condition 'afterskill'
ud->skilllv = ud->skilltarget = 0;
}
+ map_freeblock_unlock();
return 1;
} while(0);
//Skill failed.
@@ -5875,6 +5878,8 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
unit_stop_walking(src,1);
ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv);
unit_set_walkdelay(src, tick, battle_config.default_skill_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
+
+ map_freeblock_lock();
skill_castend_pos2(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv,tick,0);
if (ud->skilltimer == -1) {
@@ -5882,6 +5887,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
else ud->skillid = 0; //Non mobs can't clear this one as it is used for skill condition 'afterskill'
ud->skilllv = ud->skillx = ud->skilly = 0;
}
+ map_freeblock_unlock();
return 1;
} while(0);