summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-17 16:23:57 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-17 16:23:57 +0000
commit0c1c429e338a07638c07c4bc088311abda354c36 (patch)
tree0ce491add7f3e632b6d4f3b6f5c01ac351a8f6d2 /src
parente30cc8e4ebab164b261578ef7bb8a76978db5478 (diff)
downloadhercules-0c1c429e338a07638c07c4bc088311abda354c36.tar.gz
hercules-0c1c429e338a07638c07c4bc088311abda354c36.tar.bz2
hercules-0c1c429e338a07638c07c4bc088311abda354c36.tar.xz
hercules-0c1c429e338a07638c07c4bc088311abda354c36.zip
- Devotion absorbed damage will now appear to come from oneself (instead of the original attacker changing directions towards the Crusader)
- Updated clif_refres to send inventory, cart, and weight info. - Fixed intif_guild_memberinfoshort to not leave a dangling pointer when someone logs out <.< - Cleaned up a bit guild_check_member git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7226 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c9
-rw-r--r--src/map/guild.c48
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/status.c2
4 files changed, 33 insertions, 28 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 9c6d0e97a..8dfcb40cf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7554,7 +7554,14 @@ int clif_specialeffect(struct block_list *bl, int type, int flag)
int clif_refresh(struct map_session_data *sd) {
nullpo_retr(-1, sd);
clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
- map_foreachinarea(clif_getareachar,sd->bl.m,sd->bl.x-AREA_SIZE,sd->bl.y-AREA_SIZE,sd->bl.x+AREA_SIZE,sd->bl.y+AREA_SIZE,BL_ALL,sd);
+ clif_inventorylist(sd);
+ if(pc_iscarton(sd)){
+ clif_cartlist(sd);
+ clif_updatestatus(sd,SP_CARTINFO);
+ }
+ clif_updatestatus(sd,SP_MAXWEIGHT);
+ clif_updatestatus(sd,SP_WEIGHT);
+ map_foreachinrange(clif_getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
return 0;
}
diff --git a/src/map/guild.c b/src/map/guild.c
index 751f2efad..0d2f2cad1 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -490,9 +490,9 @@ int guild_npc_request_info(int guild_id,const char *event)
}
// 所属キャラの確認
-int guild_check_member(const struct guild *g)
+int guild_check_member(struct guild *g)
{
- int i, users;
+ int i, j, users;
struct map_session_data *sd, **all_sd;
nullpo_retr(0, g);
@@ -500,21 +500,15 @@ int guild_check_member(const struct guild *g)
all_sd = map_getallusers(&users);
for(i=0;i<users;i++){
- if((sd=all_sd[i])){
- if(sd->status.guild_id==g->guild_id){
- int j,f=1;
- for(j=0;j<MAX_GUILD;j++){ // データがあるか
- if( g->member[j].account_id==sd->status.account_id &&
- g->member[j].char_id==sd->status.char_id)
- f=0;
- }
- if(f){
- sd->status.guild_id=0;
- sd->state.guild_sent=0;
- sd->guild_emblem_id=0;
- if(battle_config.error_log)
- ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
- }
+ sd=all_sd[i];
+ if(sd->status.guild_id==g->guild_id){
+ j=guild_getindex(g,sd->status.account_id,sd->status.char_id);
+ if (j < 0) {
+ sd->status.guild_id=0;
+ sd->state.guild_sent=0;
+ sd->guild_emblem_id=0;
+ if(battle_config.error_log)
+ ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
}
}
}
@@ -893,19 +887,23 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
intif_guild_memberinfoshort(g->guild_id,
sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
+ if(!online) //REMOVE sd pointer or you get a dangling pointer! [Skotlex]
+ {
+ int i = guild_getindex(g,sd->status.account_id,sd->status.char_id);
+ if (i >= 0)
+ g->member[i].sd = NULL;
+ }
+
if(sd->state.guild_sent)
return 0;
- guild_check_conflict(sd); // mystery check
+// guild_check_conflict(sd); // Check if char belongs to more than one guild? Should be unneeded.
- if(sd->status.guild_id == g->guild_id){
+ clif_guild_belonginfo(sd,g);
+ clif_guild_notice(sd,g);
- clif_guild_belonginfo(sd,g);
- clif_guild_notice(sd,g);
-
- sd->state.guild_sent = 1;
- sd->guild_emblem_id = g->emblem_id;
- }
+ sd->state.guild_sent = 1;
+ sd->guild_emblem_id = g->emblem_id;
return 0;
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 5a57d69e2..18d255da7 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7236,7 +7236,7 @@ int pc_readdb(void)
max_level[job][type]--;
if (max_level[job][type] < max) {
ShowWarning("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", max, job, max_level[job][type]);
- ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n");
+ ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n", max);
max_level[job][type] = max;
}
// ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job, max_level[job][type]);
diff --git a/src/map/status.c b/src/map/status.c
index ce52d17ad..06ae11d33 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -572,7 +572,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
struct map_session_data *sd2 = map_id2sd(sc->data[SC_DEVOTION].val1);
if (sd2 && sd2->devotion[sc->data[SC_DEVOTION].val2] == target->id)
{
- clif_damage(src, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
+ clif_damage(&sd2->bl, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
status_fix_damage(NULL, &sd2->bl, hp, 0);
return 0;
}