summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/int_guild.c6
-rw-r--r--src/char_sql/int_guild.c6
-rw-r--r--src/map/script.c8
3 files changed, 14 insertions, 6 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index dbd7ee615..8577b2a66 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1111,8 +1111,10 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id,
if (g->member[i].online)
g->connect_member++;
}
- // 平均レベル
- g->average_lv = alv / c;
+
+ if (c)
+ // 平均レベル
+ g->average_lv = alv / c;
return 0;
}
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 030201aa4..5fee88511 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -1294,8 +1294,10 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,
if( g->member[i].online )
g->connect_member++;
}
- // 平均レベル
- g->average_lv=alv/c;
+
+ if (c)
+ // 平均レベル
+ g->average_lv=alv/c;
sprintf(tmp_sql, "UPDATE `%s` SET `connect_member`=%d,`average_lv`=%d WHERE `guild_id`='%d'", guild_db, g->connect_member, g->average_lv, g->guild_id);
if(mysql_query(&mysql_handle, tmp_sql) )
diff --git a/src/map/script.c b/src/map/script.c
index 91245d19e..788c755e5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5466,14 +5466,18 @@ int buildin_strmobinfo(struct script_state *st)
if(num==1) {
char *buf;
buf=aCalloc(24, 1);
- buf=mob_db[class].name;
+// buf=mob_db[class].name;
+// for string assignments you would need to go for c++ [Shinomori]
+ strcpy(buf,mob_db[class].name);
push_str(st->stack,C_STR,buf);
return 0;
}
else if(num==2) {
char *buf;
buf=aCalloc(24, 1);
- buf=mob_db[class].jname;
+// buf=mob_db[class].jname;
+// for string assignments you would need to go for c++ [Shinomori]
+ strcpy(buf,mob_db[class].jname);
push_str(st->stack,C_STR,buf);
return 0;
}