summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-28 16:26:08 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-28 16:26:08 +0000
commit19082e5aa65c7c1ba3bc679393132b8e94f2693b (patch)
tree418a4dbe2a62440d757330a2682e1108d8764be7
parent6a9d17e48f65570c8504e862cfeb8fe3822a59c8 (diff)
downloadhercules-19082e5aa65c7c1ba3bc679393132b8e94f2693b.tar.gz
hercules-19082e5aa65c7c1ba3bc679393132b8e94f2693b.tar.bz2
hercules-19082e5aa65c7c1ba3bc679393132b8e94f2693b.tar.xz
hercules-19082e5aa65c7c1ba3bc679393132b8e94f2693b.zip
- Fixed a possible crash due to the recent core.c upgrade.
- Changing setting the Guild Master from pc_authok to clif_parse_LoadEndAck so that it will not fail to set the gmaster flag when the first person of a guild to log on is the guild master. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9347 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/common/core.c10
-rw-r--r--src/map/clif.c10
-rw-r--r--src/map/pc.c17
-rw-r--r--src/map/skill.c2
5 files changed, 22 insertions, 20 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index b867b1b9e..b4217c34c 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ 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.
2006/11/28
+ * Changing setting the Guild Master from pc_authok to clif_parse_LoadEndAck
+ so that it will not fail to set the gmaster flag when the first person of a
+ guild to log on is the guild master. [Skotlex]
* Modified the way Storm Gust freeze's counter works. Now it checks for the
caster of the Storm Gust, if it's the same as the previous hit, the counter
is increased, otherwise, the ID is updated and the counter is changed to 1.
diff --git a/src/common/core.c b/src/common/core.c
index 1f361bd95..06ee6b2b8 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -227,9 +227,13 @@ int main (int argc, char **argv)
// initialise program arguments
{
- char *p = SERVER_NAME = argv[0];
- while ((p = strchr(p, '/')) != NULL || (p = strchr(p, '\\')) != NULL)
- SERVER_NAME = ++p;
+ char *p1 = SERVER_NAME = argv[0];
+ char *p2 = p1;
+ while ((p1 = strchr(p2, '/')) != NULL || (p1 = strchr(p2, '\\')) != NULL)
+ {
+ SERVER_NAME = ++p1;
+ p2 = p1;
+ }
arg_c = argc;
arg_v = argv;
#ifndef SVNVERSION
diff --git a/src/map/clif.c b/src/map/clif.c
index 5c2157aa2..380a57095 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8376,6 +8376,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->state.connect_new) {
int lv;
+ struct guild *g;
sd->state.connect_new = 0;
clif_skillinfoblock(sd);
clif_updatestatus(sd,SP_NEXTBASEEXP);
@@ -8405,6 +8406,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->hd)
merc_hom_init_timers(sd->hd);
+ if (sd->status.guild_id > 0 && !sd->state.gmaster_flag &&
+ (g=guild_search(sd->status.guild_id)) &&
+ strcmp(sd->status.name,g->master) == 0)
+ { //Block Guild Skills to prevent logout/login reuse exploiting. [Skotlex]
+ guild_block_skill(sd, 300000);
+ //Also set the Guild Master flag.
+ sd->state.gmaster_flag = g;
+ }
+
//Delayed night effect on log-on fix for the glow-issue. Thanks to Larry.
if (night_flag && map[sd->bl.m].flag.nightenabled)
add_timer(gettick()+1000,clif_nighttimer,sd->bl.id,0);
diff --git a/src/map/pc.c b/src/map/pc.c
index 5a41868d2..80ce76857 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -565,7 +565,6 @@ int pc_isequip(struct map_session_data *sd,int n)
*/
int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_time, struct mmo_charstatus *st)
{
- struct guild *g;
int i;
unsigned long tick = gettick();
@@ -670,22 +669,10 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
if (sd->status.hom_id > 0)
intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
- // パ?ティ、ギルドデ?タの要求
if (sd->status.party_id > 0 && party_search(sd->status.party_id) == NULL)
party_request_info(sd->status.party_id);
- if (sd->status.guild_id > 0)
- {
- if ((g = guild_search(sd->status.guild_id)) == NULL)
- guild_request_info(sd->status.guild_id);
- else if (strcmp(sd->status.name,g->master) == 0)
- { //Block Guild Skills to prevent logout/login reuse exploiting. [Skotlex]
- guild_block_skill(sd, 300000);
- //Also set the Guild Master flag.
- sd->state.gmaster_flag = g;
- }
- }
-
- // 通知
+ if (sd->status.guild_id > 0 && guild_search(sd->status.guild_id) == NULL)
+ guild_request_info(sd->status.guild_id);
clif_authok(sd);
map_addiddb(&sd->bl);
diff --git a/src/map/skill.c b/src/map/skill.c
index ee3619822..60153cfb5 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8355,8 +8355,6 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
case GD_EMERGENCYCALL:
if (!sd->status.guild_id || !sd->state.gmaster_flag)
return 0;
- if (lv <= 0)
- return 0;
break;
case GS_GLITTERING: