summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/int_guild.c50
-rw-r--r--src/map/atcommand.c14
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/skill.c12
-rw-r--r--src/map/unit.c4
7 files changed, 41 insertions, 47 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 305847c1d..9090bc007 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -112,7 +112,7 @@ int inter_guild_tosql(struct guild *g,int flag)
// GS_POSITION `guild_position` (`guild_id`,`position`,`name`,`mode`,`exp_mode`)
// GS_ALLIANCE `guild_alliance` (`guild_id`,`opposition`,`alliance_id`,`name`)
// GS_EXPULSION `guild_expulsion` (`guild_id`,`account_id`,`name`,`mes`)
- // GS_SKILL `guild_skill` (`guild_id`,`id`,`lv`)
+ // GS_SKILL `guild_skill` (`guild_id`,`id`,`lv`)
// temporary storage for str convertion. They must be twice the size of the
// original string to ensure no overflows will occur. [Skotlex]
@@ -123,7 +123,7 @@ int inter_guild_tosql(struct guild *g,int flag)
int i=0;
if (g->guild_id<=0 && g->guild_id != -1) return 0;
-
+
#ifdef NOISY
ShowInfo("Save guild request ("CL_BOLD"%d"CL_RESET" - flag 0x%x).",g->guild_id, flag);
#endif
@@ -179,7 +179,7 @@ int inter_guild_tosql(struct guild *g,int flag)
StringBuf_Printf(&buf, "`emblem_len`=%d, `emblem_id`=%d, `emblem_data`='%s'", g->emblem_len, g->emblem_id, emblem_data);
add_comma = true;
}
- if (flag & GS_BASIC)
+ if (flag & GS_BASIC)
{
strcat(t_info, " basic");
if( add_comma )
@@ -273,8 +273,8 @@ int inter_guild_tosql(struct guild *g,int flag)
if (flag&GS_ALLIANCE)
{
- // Delete current alliances
- // NOTE: no need to do it on both sides since both guilds in memory had
+ // Delete current alliances
+ // NOTE: no need to do it on both sides since both guilds in memory had
// their info changed, not to mention this would also mess up oppositions!
// [Skotlex]
//if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `guild_id`='%d' OR `alliance_id`='%d'", guild_alliance_db, g->guild_id, g->guild_id) )
@@ -516,7 +516,7 @@ struct guild * inter_guild_fromsql(int guild_id)
idb_put(guild_db_, guild_id, g); //Add to cache
g->save_flag |= GS_REMOVE; //But set it to be removed, in case it is not needed for long.
-
+
if (save_log)
ShowInfo("Guild loaded (%d - %s)\n", guild_id, g->name);
@@ -602,12 +602,12 @@ static struct guild_castle* inter_guildcastle_fromsql(int castle_id)
static bool exp_guild_parse_row(char* split[], int column, int current)
{
int exp = atoi(split[0]);
-
+
if (exp < 0 || exp >= INT_MAX) {
ShowError("exp_guild: Invalid exp %d at line %d\n", exp, current);
return false;
}
-
+
guild_exp[current] = exp;
return true;
}
@@ -617,7 +617,7 @@ int inter_guild_CharOnline(int char_id, int guild_id)
{
struct guild *g;
int i;
-
+
if (guild_id == -1) {
//Get guild_id from the database
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT guild_id FROM `%s` WHERE char_id='%d'", char_db, char_id) )
@@ -641,7 +641,7 @@ int inter_guild_CharOnline(int char_id, int guild_id)
}
if (guild_id == 0)
return 0; //No guild...
-
+
g = inter_guild_fromsql(guild_id);
if(!g) {
ShowError("Character %d's guild %d not found!\n", char_id, guild_id);
@@ -692,7 +692,7 @@ int inter_guild_CharOffline(int char_id, int guild_id)
}
if (guild_id == 0)
return 0; //No guild...
-
+
//Character has a guild, set character offline and check if they were the only member online
g = inter_guild_fromsql(guild_id);
if (g == NULL) //Guild not found?
@@ -758,7 +758,7 @@ int search_guildname(char *str)
{
int guild_id;
char esc_name[NAME_LENGTH*2+1];
-
+
Sql_EscapeStringLen(sql_handle, esc_name, str, safestrnlen(str, NAME_LENGTH));
//Lookup guilds with the same name
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT guild_id FROM `%s` WHERE name='%s'", guild_db, esc_name) )
@@ -837,13 +837,13 @@ int guild_calcinfo(struct guild *g)
g->next_exp = nextexp;
// Set the max number of members, Guild Extention skill - currently adds 6 to max per skill lv.
- g->max_member = 16 + guild_checkskill(g, GD_EXTENSION) * 6;
+ g->max_member = 16 + guild_checkskill(g, GD_EXTENSION) * 6;
if(g->max_member > MAX_GUILD)
{
ShowError("Guild %d:%s has capacity for too many guild members (%d), max supported is %d\n", g->guild_id, g->name, g->max_member, MAX_GUILD);
g->max_member = MAX_GUILD;
}
-
+
// Compute the guild average level level
g->average_lv=0;
g->connect_member=0;
@@ -1193,7 +1193,7 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member
return 0;
}
ShowInfo("Created Guild %d - %s (Guild Master: %s)\n", g->guild_id, g->name, g->master);
-
+
//Add to cache
idb_put(guild_db_, g->guild_id, g);
@@ -1326,7 +1326,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,int account_id,in
g = inter_guild_fromsql(guild_id);
if(g==NULL)
return 0;
-
+
ARR_FIND( 0, g->max_member, i, g->member[i].account_id == account_id && g->member[i].char_id == char_id );
if( i < g->max_member )
{
@@ -1372,7 +1372,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,int account_id,in
int mapif_parse_BreakGuild(int fd,int guild_id)
{
struct guild * g;
-
+
g = inter_guild_fromsql(guild_id);
if(g==NULL)
return 0;
@@ -1423,7 +1423,7 @@ int mapif_parse_GuildMessage(int fd,int guild_id,int account_id,char *mes,int le
return mapif_guild_message(guild_id,account_id,mes,len, fd);
}
-// Modification of the guild
+// Modification of the guild
int mapif_parse_GuildBasicInfoChange(int fd,int guild_id,int type,const char *data,int len)
{
struct guild * g;
@@ -1453,7 +1453,7 @@ int mapif_parse_GuildBasicInfoChange(int fd,int guild_id,int type,const char *da
return 0;
}
-// Modification of the guild
+// Modification of the guild
int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,int account_id,int char_id,int type,const char *data,int len)
{
// Could make some improvement in speed, because only change guild_member
@@ -1598,7 +1598,7 @@ int inter_guild_charname_changed(int guild_id,int account_id, int char_id, char
return 0;
mapif_guild_info(-1,g);
-
+
return 0;
}
@@ -1653,7 +1653,7 @@ static int mapif_parse_GuildDeleteAlliance(struct guild *g, int guild_id, int ac
strcpy(name, g->alliance[i].name);
g->alliance[i].guild_id=0;
-
+
mapif_guild_alliance(g->guild_id,guild_id,account_id1,account_id2,flag,g->name,name);
g->save_flag |= GS_ALLIANCE;
return 0;
@@ -1670,7 +1670,7 @@ int mapif_parse_GuildAlliance(int fd,int guild_id1,int guild_id2,int account_id1
if(g[0] && g[1]==NULL && (flag & GUILD_ALLIANCE_REMOVE)) //Requested to remove an alliance with a not found guild.
return mapif_parse_GuildDeleteAlliance(g[0], guild_id2, account_id1, account_id2, flag); //Try to do a manual removal of said guild.
-
+
if(g[0]==NULL || g[1]==NULL)
return 0;
@@ -1794,16 +1794,16 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
int pos;
g = inter_guild_fromsql(guild_id);
-
+
if(g==NULL || len > NAME_LENGTH)
return 0;
-
+
// Find member (name)
for (pos = 0; pos < g->max_member && strncmp(g->member[pos].name, name, len); pos++);
if (pos == g->max_member)
return 0; //Character not found??
-
+
// Switch current and old GM
memcpy(&gm, &g->member[pos], sizeof (struct guild_member));
memcpy(&g->member[pos], &g->member[0], sizeof(struct guild_member));
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 8f6fa41ac..1c7e37392 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3171,7 +3171,7 @@ ACMD_FUNC(questskill)
return -1;
}
- if (skill_id < 0 && skill_id >= MAX_SKILL_DB) {
+ if (skill_id >= MAX_SKILL_DB) {
clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
@@ -3215,7 +3215,7 @@ ACMD_FUNC(lostskill)
return -1;
}
- if (skill_id < 0 && skill_id >= MAX_SKILL) {
+ if (skill_id >= MAX_SKILL) {
clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
@@ -5416,13 +5416,13 @@ ACMD_FUNC(useskill)
char target[100];
nullpo_retr(-1, sd);
- if(!message || !*message || sscanf(message, "%hui %hui %23[^\n]", &skill_id, &skill_lv, target) != 3) {
+ if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
clif_displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
return -1;
}
- if ( (pl_sd = map_nick2sd(target)) == NULL )
- {
+ if(!strcmp(target,"self")) pl_sd = sd; //quick keyword
+ else if ( (pl_sd = map_nick2sd(target)) == NULL ){
clif_displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
@@ -5460,7 +5460,7 @@ ACMD_FUNC(displayskill)
uint16 skill_lv = 1;
nullpo_retr(-1, sd);
- if (!message || !*message || sscanf(message, "%hui %hui", &skill_id, &skill_lv) < 1)
+ if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1)
{
clif_displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
return -1;
@@ -5486,7 +5486,7 @@ ACMD_FUNC(skilltree)
struct skill_tree_entry *ent;
nullpo_retr(-1, sd);
- if(!message || !*message || sscanf(message, "%hui %23[^\r\n]", &skill_id, target) != 2) {
+ if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
clif_displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
return -1;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index d6bcc6060..87f1e7196 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5846,7 +5846,7 @@ static const struct _battle_data {
{ "max_third_parameter", &battle_config.max_third_parameter, 120, 10, 10000, },
{ "max_baby_third_parameter", &battle_config.max_baby_third_parameter, 108, 10, 10000, },
{ "atcommand_max_stat_bypass", &battle_config.atcommand_max_stat_bypass, 0, 0, 100, },
- { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 100 },
+ { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 300 },
{ "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 },
{ "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 },
{ "min_npc_vending_distance", &battle_config.min_npc_vending_distance, 3, 0, 100 },
diff --git a/src/map/clif.c b/src/map/clif.c
index 2199bf12a..4b5e34232 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5257,7 +5257,7 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, uint16 skill_id ,
for(i=0,c=0;i<MAX_SKILL_PRODUCE_DB;i++){
if( skill_can_produce_mix(sd,skill_produce_db[i].nameid, trigger, 1) &&
- ( ( skill_id > 0 && skill_produce_db[i].req_skill == skill_id ) || skill_id < 0 )
+ ( skill_id > 0 && skill_produce_db[i].req_skill == skill_id )
){
if((view = itemdb_viewid(skill_produce_db[i].nameid)) > 0)
WFIFOW(fd,c*8+ 4)= view;
diff --git a/src/map/pc.c b/src/map/pc.c
index 3af065db8..c7d5b87f0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4882,7 +4882,7 @@ int pc_checkskill(struct map_session_data *sd,uint16 skill_id)
return guild_checkskill(g,skill_id);
return 0;
}
- else if( skill_id < 0 || skill_id >= ARRAYLENGTH(sd->status.skill) )
+ else if(skill_id >= ARRAYLENGTH(sd->status.skill) )
{
ShowError("pc_checkskill: Invalid skill id %d (char_id=%d).\n", skill_id, sd->status.char_id);
return 0;
@@ -5976,7 +5976,7 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id)
return 0;
}
- if( skill_id < 0 || skill_id >= MAX_SKILL )
+ if(skill_id >= MAX_SKILL )
return 0;
if( sd->status.skill_point > 0 &&
diff --git a/src/map/skill.c b/src/map/skill.c
index 918d10b53..d0319afb1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -524,7 +524,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
// allowing a skill to be cast. This is to prevent no-delay ACT files from spamming skills such as
// AC_DOUBLE which do not have a skill delay and are not regarded in terms of attack motion.
if( !sd->state.autocast && sd->skillitem != skill_id && sd->canskill_tick &&
- DIFF_TICK(gettick(), sd->canskill_tick) < (sd->battle_status.amotion * (100 + battle_config.skill_amotion_leniency) / 100) )
+ DIFF_TICK(gettick(), sd->canskill_tick) < (sd->battle_status.amotion * (battle_config.skill_amotion_leniency) / 100) )
{// attempted to cast a skill before the attack motion has finished
return 1;
}
@@ -724,7 +724,6 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
nullpo_ret(src);
nullpo_ret(bl);
- if(skill_id < 0) return 0;
if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest
if( dmg_lv < ATK_BLOCK ) // Don't apply effect if miss.
@@ -1746,7 +1745,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
nullpo_ret(src);
nullpo_ret(bl);
- if(skill_id < 0) return 0;
if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest
sd = BL_CAST(BL_PC, src);
@@ -3724,10 +3722,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else if( dir == 7 || dir < 2 ) y = i;
else y = 0;
if( (mbl == src || !map_flag_gvg(src->m) && !map[src->m].flag.battleground) && // only NJ_ISSEN don't have slide effect in GVG
- unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) {
+ unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) {
clif_slide(src, src->x, src->y);
//uncomment this if you want to remove MO_EXTREMITYFIST glitchy walking effect. [malufett]
- //clif_fixpos(src);
+ //clif_fixpos(src);
}
}
break;
@@ -7823,7 +7821,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( src == bl ) rate = 100; // Success Chance: On self, 100%
else if(bl->type == BL_PC) rate += 20 + 10 * skill_lv; // On Players, (20 + 10 * Skill Level) %
else rate += 40 + 10 * skill_lv; // On Monsters, (40 + 10 * Skill Level) %
-
+
if( sd )
skill_blockpc_start(sd,skill_id,4000);
@@ -9355,7 +9353,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
#endif
}
if (target && target->m == src->m)
- { //Move character to target anyway.
+ { //Move character to target anyway.
if (unit_movepos(src, src->x+3, src->y+3, 1, 1))
{ //Display movement + animation.
clif_slide(src,src->x,src->y);
diff --git a/src/map/unit.c b/src/map/unit.c
index 110fcb079..eb8eac589 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -866,8 +866,6 @@ int unit_stop_walking(struct block_list *bl,int type)
int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv)
{
- if(skill_id < 0) return 0;
-
return unit_skilluse_id2(
src, target_id, skill_id, skill_lv,
skill_castfix(src, skill_id, skill_lv),
@@ -1368,8 +1366,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv)
{
- if(skill_id < 0)
- return 0;
return unit_skilluse_pos2(
src, skill_x, skill_y, skill_id, skill_lv,
skill_castfix(src, skill_id, skill_lv),