summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 245df05e5..71e343db0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -446,7 +446,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
if (idx == 0)
return 1; // invalid skill id
- if (pc->has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
+ if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
return 0; // can do any damn thing they want
if( skill_id == AL_TELEPORT && sd->skillitem == skill_id && sd->skillitemlv > 2 )
@@ -6309,7 +6309,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case MC_VENDING:
if(sd)
{ //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]
- if ( !pc->can_give_items(sd) )
+ if ( !pc_can_give_items(sd) )
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
else {
sd->state.prevend = sd->state.workinprogress = 3;
@@ -12262,7 +12262,7 @@ int skill_check_pc_partner (struct map_session_data *sd, uint16 skill_id, uint16
int i;
bool is_chorus = ( skill->get_inf2(skill_id)&INF2_CHORUS_SKILL );
- if (!battle_config.player_skill_partner_check || pc->has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
+ if (!battle_config.player_skill_partner_check || pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
return is_chorus ? MAX_PARTY : 99; //As if there were infinite partners.
if (cast_flag) { //Execute the skill on the partners.
@@ -12358,7 +12358,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if (sd->chatID) return 0;
- if( pc->has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id )
+ if( pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id )
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
sd->state.arrow_atk = skill->get_ammotype(skill_id)?1:0; //Need to do arrow state check.
sd->spiritball_old = sd->spiritball; //Need to do Spiritball check.
@@ -13282,7 +13282,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
if( sd->chatID )
return 0;
- if( pc->has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id ) {
+ if( pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id ) {
//GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
sd->state.arrow_atk = skill->get_ammotype(skill_id)?1:0; //Need to do arrow state check.
sd->spiritball_old = sd->spiritball; //Need to do Spiritball check.
@@ -17141,10 +17141,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick)
if( !(cd = idb_get(skill->cd_db,sd->status.char_id)) ) {// create a new skill cooldown object for map storage
cd = ers_alloc(skill->cd_ers, struct skill_cd);
-
- cd->cursor = 0;
- memset(cd->entry, 0, sizeof(cd->entry));
-
+
idb_put( skill->cd_db, sd->status.char_id, cd );
} else {
int i;
@@ -18215,9 +18212,9 @@ int do_init_skill(bool minimal) {
skill->cd_db = idb_alloc(DB_OPT_BASE);
skill->usave_db = idb_alloc(DB_OPT_RELEASE_DATA);
- skill->unit_ers = ers_new(sizeof(struct skill_unit_group),"skill.c::skill_unit_ers",ERS_OPT_NONE);
+ skill->unit_ers = ers_new(sizeof(struct skill_unit_group),"skill.c::skill_unit_ers",ERS_OPT_CLEAN);
skill->timer_ers = ers_new(sizeof(struct skill_timerskill),"skill.c::skill_timer_ers",ERS_OPT_NONE);
- skill->cd_ers = ers_new(sizeof(struct skill_cd),"skill.c::skill_cd_ers",ERS_OPT_CLEAR);
+ skill->cd_ers = ers_new(sizeof(struct skill_cd),"skill.c::skill_cd_ers",ERS_OPT_CLEAR|ERS_OPT_CLEAN);
skill->cd_entry_ers = ers_new(sizeof(struct skill_cd_entry),"skill.c::skill_cd_entry_ers",ERS_OPT_CLEAR);
ers_chunk_size(skill->cd_ers, 25);