summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
committershennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
commit7e72f0cee8867837be53cb2119b610b00e9bd587 (patch)
tree22ab404109fb2def22cf0085fcec2bf174210970 /src/char/int_guild.c
parent237d76e7c409251b5fdb9f3eee40ef3fe5dc2b25 (diff)
downloadhercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.gz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.bz2
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.xz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.zip
Improvements all over the place
Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 7c2086722..46bba63db 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -217,8 +217,8 @@ int inter_guild_tosql(struct guild *g,int flag)
strcat(t_info, " level");
if( add_comma )
StringBuf_AppendStr(&buf, ", ");
- else
- add_comma = true;
+ //else //last condition using add_coma setting
+ // add_comma = true;
StringBuf_Printf(&buf, "`guild_lv`=%d, `skill_point`=%d, `exp`=%"PRIu64", `next_exp`=%u, `max_member`=%d", g->guild_lv, g->skill_point, g->exp, g->next_exp, g->max_member);
}
StringBuf_Printf(&buf, " WHERE `guild_id`=%d", g->guild_id);
@@ -509,7 +509,7 @@ struct guild * inter_guild_fromsql(int guild_id)
{
int id;
Sql_GetData(sql_handle, 0, &data, NULL); id = atoi(data) - GD_SKILLBASE;
- if( id < 0 && id >= MAX_GUILDSKILL )
+ if( id < 0 || id >= MAX_GUILDSKILL )
continue;// invalid guild skill
Sql_GetData(sql_handle, 1, &data, NULL); g->skill[id].lv = atoi(data);
}
@@ -604,7 +604,7 @@ static bool exp_guild_parse_row(char* split[], int column, int current)
{
unsigned int exp = (unsigned int)atol(split[0]);
- if (exp < 0 || exp >= UINT_MAX) {
+ if (exp >= UINT_MAX) {
ShowError("exp_guild: Invalid exp %d at line %d\n", exp, current);
return false;
}
@@ -1262,7 +1262,7 @@ int mapif_parse_GuildAddMember(int fd,int guild_id,struct guild_member *m)
// Delete member from guild
int mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id, int flag, const char *mes)
{
- int i, j;
+ int i;
struct guild* g = inter_guild_fromsql(guild_id);
if( g == NULL )
@@ -1285,6 +1285,7 @@ int mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id, in
if( flag )
{ // Write expulsion reason
// Find an empty slot
+ int j;
ARR_FIND( 0, MAX_GUILDEXPULSION, j, g->expulsion[j].account_id == 0 );
if( j == MAX_GUILDEXPULSION )
{