summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskyleo <skyleo@skyleo.de>2019-11-17 13:35:15 +0100
committerHaru <haru@dotalux.com>2020-03-08 20:59:35 +0100
commitddd62450518afd71bd72f914196b6a2eac7e6bd3 (patch)
tree6e2aabd88f519ff681a9eeed132e8863c0a56cd9
parent3077a395f8ff1bc86972914f2f94d58e893e2aa7 (diff)
downloadhercules-ddd62450518afd71bd72f914196b6a2eac7e6bd3.tar.gz
hercules-ddd62450518afd71bd72f914196b6a2eac7e6bd3.tar.bz2
hercules-ddd62450518afd71bd72f914196b6a2eac7e6bd3.tar.xz
hercules-ddd62450518afd71bd72f914196b6a2eac7e6bd3.zip
Change the name of all functions which got their return-value meaning changed
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/elemental.c2
-rw-r--r--src/map/mob.c6
-rw-r--r--src/map/pet.c4
-rw-r--r--src/map/script.c28
-rw-r--r--src/map/skill.c14
-rw-r--r--src/map/unit.c88
-rw-r--r--src/map/unit.h12
8 files changed, 81 insertions, 81 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a0ffeac32..a8b6ea768 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4900,7 +4900,7 @@ static int clif_damage(struct block_list *src, struct block_list *dst, int sdela
}
if(src == dst) {
- unit->setdir(src,unit->getdir(src));
+ unit->set_dir(src, unit->getdir(src));
}
//Return adjusted can't walk delay for further processing.
@@ -11130,7 +11130,7 @@ static void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
//Set last idle time... [Skotlex]
pc->update_idle_time(sd, BCIDLE_WALK);
- unit->walktoxy(&sd->bl, x, y, 4);
+ unit->walk_toxy(&sd->bl, x, y, 4);
}
/// Notification about the result of a disconnect request (ZC_ACK_REQ_DISCONNECT).
@@ -16451,7 +16451,7 @@ static void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd)
unit->calc_pos(bl, sd->bl.x, sd->bl.y, sd->ud.dir);
ud = unit->bl2ud(bl);
- unit->walktoxy(bl, ud->to_x, ud->to_y, 4);
+ unit->walk_toxy(bl, ud->to_x, ud->to_y, 4);
}
static void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -16475,7 +16475,7 @@ static void clif_parse_HomMoveTo(int fd, struct map_session_data *sd)
else
return;
- unit->walktoxy(bl, x, y, 4);
+ unit->walk_toxy(bl, x, y, 4);
}
static void clif_parse_HomAttack(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
diff --git a/src/map/elemental.c b/src/map/elemental.c
index e9b6fa372..f176bb9e2 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -789,7 +789,7 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_
if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 )
return 0; //Can't move yet.
if (map->search_freecell(&ed->bl, sd->bl.m, &x, &y, MIN_ELEDISTANCE, MIN_ELEDISTANCE, 1) != 0
- && unit->walktoxy(&ed->bl, x, y, 0) == 0)
+ && unit->walk_toxy(&ed->bl, x, y, 0) == 0)
return 0;
}
diff --git a/src/map/mob.c b/src/map/mob.c
index 431bdbe0d..51a32abd9 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1462,7 +1462,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick)
// If master is BL_MOB and in battle, lock & chase to master's target instead, unless configured not to.
if ((battle_config.slave_chase_masters_chasetarget == 0 || (m_md != NULL && !mob->is_in_battle_state(m_md)))
&& map->search_freecell(&md->bl, bl->m, &x, &y, MOB_SLAVEDISTANCE, MOB_SLAVEDISTANCE, 1)
- && unit->walktoxy(&md->bl, x, y, 0) == 0)
+ && unit->walk_toxy(&md->bl, x, y, 0) == 0)
return 1;
}
} else if (bl->m != md->bl.m && map_flag_gvg(md->bl.m)) {
@@ -1544,7 +1544,7 @@ static int mob_unlocktarget(struct mob_data *md, int64 tick)
unit->set_target(&md->ud, 0);
}
if(battle_config.official_cell_stack_limit && map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR|BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) {
- unit->walktoxy(&md->bl, md->bl.x, md->bl.y, 8);
+ unit->walk_toxy(&md->bl, md->bl.x, md->bl.y, 8);
}
return 0;
@@ -1577,7 +1577,7 @@ static int mob_randomwalk(struct mob_data *md, int64 tick)
y+=md->bl.y;
if ((x != md->bl.x || y != md->bl.y) && map->getcell(md->bl.m, &md->bl, x, y, CELL_CHKPASS) != 0
- && unit->walktoxy(&md->bl, x, y, 8) == 0)
+ && unit->walk_toxy(&md->bl, x, y, 8) == 0)
break;
}
if(i==retrycount){
diff --git a/src/map/pet.c b/src/map/pet.c
index 0537baaa7..aeb372c05 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -892,7 +892,7 @@ static int pet_randomwalk(struct pet_data *pd, int64 tick)
int x=pd->bl.x+r%(d*2+1)-d;
int y=pd->bl.y+r/(d*2+1)%(d*2+1)-d;
if (map->getcell(pd->bl.m, &pd->bl, x, y, CELL_CHKPASS) != 0
- && unit->walktoxy(&pd->bl, x, y, 0) == 0) {
+ && unit->walk_toxy(&pd->bl, x, y, 0) == 0) {
pd->move_fail_count=0;
break;
}
@@ -992,7 +992,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int
return 0; //Already walking to him
unit->calc_pos(&pd->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
- if (unit->walktoxy(&pd->bl, pd->ud.to_x, pd->ud.to_y, 0) != 0)
+ if (unit->walk_toxy(&pd->bl, pd->ud.to_x, pd->ud.to_y, 0) != 0)
pet->randomwalk(pd,tick);
return 0;
diff --git a/src/map/script.c b/src/map/script.c
index d6462384d..3bf0464e7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16558,7 +16558,7 @@ static BUILDIN(npcwalkto)
} else {
status_calc_npc(nd, SCO_NONE);
}
- unit->walktoxy(&nd->bl, x, y, 0);
+ unit->walk_toxy(&nd->bl, x, y, 0);
}
return true;
@@ -19680,7 +19680,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_SPEED:
@@ -19727,7 +19727,7 @@ static BUILDIN(setunitdata)
clif->changelook(bl, LOOK_WEAPON, val);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_CANMOVETICK:
md->ud.canmove_tick = val;
@@ -19851,7 +19851,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_SPEED:
@@ -19859,7 +19859,7 @@ static BUILDIN(setunitdata)
status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_CANMOVETICK:
hd->ud.canmove_tick = val;
@@ -19990,7 +19990,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_SPEED:
@@ -19998,7 +19998,7 @@ static BUILDIN(setunitdata)
status->calc_misc(bl, &pd->status, pd->pet.level);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_CANMOVETICK:
pd->ud.canmove_tick = val;
@@ -20123,7 +20123,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_SPEED:
@@ -20131,7 +20131,7 @@ static BUILDIN(setunitdata)
status->calc_misc(bl, &mc->base_status, mc->db->lv);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_CANMOVETICK:
mc->ud.canmove_tick = val;
@@ -20257,7 +20257,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_SPEED:
@@ -20265,7 +20265,7 @@ static BUILDIN(setunitdata)
status->calc_misc(bl, &ed->base_status, ed->db->lv);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_CANMOVETICK:
ed->ud.canmove_tick = val;
@@ -20386,7 +20386,7 @@ static BUILDIN(setunitdata)
unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
break;
case UDT_WALKTOXY:
- if (unit->walktoxy(bl, (short)val, (short)val2, 2) != 0)
+ if (unit->walk_toxy(bl, (short)val, (short)val2, 2) != 0)
unit->movepos(bl, (short) val, (short) val2, 0, 0);
break;
case UDT_CLASS:
@@ -20397,7 +20397,7 @@ static BUILDIN(setunitdata)
status->calc_misc(bl, &nd->status, nd->level);
break;
case UDT_LOOKDIR:
- unit->setdir(bl, (enum unit_dir) val);
+ unit->set_dir(bl, (enum unit_dir)val);
break;
case UDT_STR:
nd->status.str = (unsigned short) val;
@@ -21121,7 +21121,7 @@ static BUILDIN(unitwalk)
if (script_hasdata(st, 4)) {
int x = script_getnum(st, 3);
int y = script_getnum(st, 4);
- if (unit->walktoxy(bl, x, y, 0) == 0) // We'll use harder calculations.
+ if (unit->walk_toxy(bl, x, y, 0) == 0) // We'll use harder calculations.
script_pushint(st, 1);
else
script_pushint(st, 0);
diff --git a/src/map/skill.c b/src/map/skill.c
index eb9efa071..b3ed46fbd 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4425,7 +4425,7 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl
skill->blown(src, bl, dist, dir, 0);
//HACK: since knockback officially defaults to the left, the client also turns to the left... therefore,
// make the caster look in the direction of the target
- unit->setdir(src, unit_get_opposite_dir(dir));
+ unit->set_dir(src, unit_get_opposite_dir(dir));
}
}
@@ -4470,7 +4470,7 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl
status_change_end(src, SC_HIDING, INVALID_TIMER);
skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
dir = unit_get_opposite_dir(dir); // change direction [Celest]
- unit->setdir(bl,dir);
+ unit->set_dir(bl, dir);
}
else if (sd)
clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
@@ -5044,7 +5044,7 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl
case RK_PHANTOMTHRUST:
{
struct map_session_data *tsd = BL_CAST(BL_PC, bl);
- unit->setdir(src,map->calc_dir(src, bl->x, bl->y));
+ unit->set_dir(src, map->calc_dir(src, bl->x, bl->y));
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,distance_bl(src,bl)-1,unit->getdir(src),0);
@@ -5871,7 +5871,7 @@ static int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
// Asura Strike caster doesn't look to their target in the end
if (src->id != target->id && !is_asura)
- unit->setdir(src, map->calc_dir(src, target->x, target->y));
+ unit->set_dir(src, map->calc_dir(src, target->x, target->y));
map->freeblock_unlock();
return 1;
@@ -8102,8 +8102,8 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
}
unit->stop_attack(src);
//Run skillv tiles overriding the can-move check.
- if (unit->walktoxy(src, (src->x + skill_lv * -dirx[dir]),
- (src->y + skill_lv * -diry[dir]), 2) == 0 && md != NULL)
+ if (unit->walk_toxy(src, src->x + skill_lv * -dirx[dir], src->y + skill_lv * -diry[dir], 2) == 0
+ && md != NULL)
md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the AI.
}
break;
@@ -10844,7 +10844,7 @@ static int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
if( sd && sd->skillitem != AL_WARP ) // Warp-Portal thru items will clear data in skill_castend_map. [Inkfish]
sd->skillitem = sd->skillitemlv = 0;
- unit->setdir(src, map->calc_dir(src, ud->skillx, ud->skilly));
+ unit->set_dir(src, map->calc_dir(src, ud->skillx, ud->skilly));
if (ud->skilltimer == INVALID_TIMER) {
if (md) md->skill_idx = -1;
diff --git a/src/map/unit.c b/src/map/unit.c
index 04035da98..418bbe4b0 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -122,7 +122,7 @@ static struct unit_data *unit_bl2ud2(struct block_list *bl)
* @param bl block_list to process
* @return 0: success, 1: fail, 2: nullpointer
*/
-static int unit_walktoxy_sub(struct block_list *bl)
+static int unit_walk_toxy_sub(struct block_list *bl)
{
nullpo_retr(2, bl);
struct unit_data *ud = unit->bl2ud(bl);
@@ -182,7 +182,7 @@ static int unit_walktoxy_sub(struct block_list *bl)
timer_delay = status->get_speed(bl);
if (timer_delay > 0)
- ud->walktimer = timer->add(timer->gettick() + timer_delay, unit->walktoxy_timer, bl->id, 0); //TODO: check if unit->walktoxy_timer uses any intptr data
+ ud->walktimer = timer->add(timer->gettick() + timer_delay, unit->walk_toxy_timer, bl->id, 0); //TODO: check if unit->walk_toxy_timer uses any intptr data
return 0;
}
@@ -194,7 +194,7 @@ static int unit_walktoxy_sub(struct block_list *bl)
* @param data: Unused
* @return 0: success, 1: fail, 2: nullpointer
*/
-static int unit_step_timer(int tid, int64 tick, int id, intptr_t data)
+static int unit_steptimer(int tid, int64 tick, int id, intptr_t data)
{
struct block_list *bl = map->id2bl(id);
if (bl == NULL || bl->prev == NULL)
@@ -204,7 +204,7 @@ static int unit_step_timer(int tid, int64 tick, int id, intptr_t data)
return 2;
if (ud->steptimer != tid) {
- ShowError("unit_step_timer mismatch %d != %d\n", ud->steptimer, tid);
+ ShowError("unit_steptimer mismatch %d != %d\n", ud->steptimer, tid);
return 1;
}
@@ -289,7 +289,7 @@ static int unit_warpto_master(struct block_list *master_bl, struct block_list *s
* @param data: unused
* @return 0: success, 1: fail
*/
-static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
+static int unit_walk_toxy_timer(int tid, int64 tick, int id, intptr_t data)
{
struct block_list *bl = map->id2bl(id);
if (bl == NULL || bl->prev == NULL) // Stop moved because it is missing from the block_list
@@ -330,7 +330,7 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
// Monsters will walk into an icewall from the west and south if they already started walking
if (map->getcell(bl->m, bl, x + dx, y + dy, CELL_CHKNOPASS)
&& (icewall_walk_block == 0 || !map->getcell(bl->m, bl, x + dx, y + dy, CELL_CHKICEWALL) || dx < 0 || dy < 0))
- return unit->walktoxy_sub(bl);
+ return unit->walk_toxy_sub(bl);
// Monsters can only leave icewalls to the west and south
// But if movement fails more than icewall_walk_block times, they can ignore this rule
@@ -416,7 +416,7 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
if (ud->stepaction && ud->target_to != 0) {
// Delete old stepaction even if not executed yet, the latest command is what counts
if (ud->steptimer != INVALID_TIMER) {
- timer->delete(ud->steptimer, unit->step_timer);
+ timer->delete(ud->steptimer, unit->steptimer);
ud->steptimer = INVALID_TIMER;
}
// Delay stepactions by half a step (so they are executed at full step)
@@ -425,11 +425,11 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
timer_delay = status->get_speed(bl) * 14 / 20;
else
timer_delay = status->get_speed(bl) / 2;
- ud->steptimer = timer->add(tick + timer_delay, unit->step_timer, bl->id, 0);
+ ud->steptimer = timer->add(tick + timer_delay, unit->steptimer, bl->id, 0);
}
if (ud->state.change_walk_target) {
- if (unit->walktoxy_sub(bl) == 0)
+ if (unit->walk_toxy_sub(bl) == 0)
return 0;
clif->fixpos(bl);
return 1;
@@ -445,7 +445,7 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
timer_delay = status->get_speed(bl);
if (timer_delay > 0) {
- ud->walktimer = timer->add(tick + timer_delay, unit->walktoxy_timer, id, 0);
+ ud->walktimer = timer->add(tick + timer_delay, unit->walk_toxy_timer, id, 0);
if (md != NULL && DIFF_TICK(tick, md->dmgtick) < 3000) // not required not damaged recently
clif->move(ud);
} else if (ud->state.running != 0) {
@@ -483,34 +483,34 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
ud->to_y = bl->y;
if (battle_config.official_cell_stack_limit != 0 && map->count_oncell(bl->m, x, y, BL_CHAR | BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) {
- // Walked on occupied cell, call unit->walktoxy again
+ // Walked on occupied cell, call unit->walk_toxy again
if (ud->steptimer != INVALID_TIMER) {
// Execute step timer on next step instead
- timer->delete(ud->steptimer, unit->step_timer);
+ timer->delete(ud->steptimer, unit->steptimer);
ud->steptimer = INVALID_TIMER;
}
- return unit->walktoxy(bl, x, y, 8);
+ return unit->walk_toxy(bl, x, y, 8);
}
}
return 0;
}
/**
- * Timer for delayed execution of unit->walktoxy once triggered
+ * Timer for delayed execution of unit->walk_toxy once triggered
* @param tid: Timer ID, unused
* @param tick: Tick, unused
* @param id: ID of block_list to execute the action
* @param data: uint32 data cast to intptr_t with x-coord in lowest 16 bits and y-coord in highest 16 bits
* @return 0: success, 1: failure
*/
-static int unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
+static int unit_delay_walk_toxy_timer(int tid, int64 tick, int id, intptr_t data)
{
struct block_list *bl = map->id2bl(id);
if (bl == NULL || bl->prev == NULL)
return 1;
short x = (short)GetWord((uint32)data, 0);
short y = (short)GetWord((uint32)data, 1);
- unit->walktoxy(bl, x, y, 0);
+ unit->walk_toxy(bl, x, y, 0);
return 0;
}
@@ -527,7 +527,7 @@ static int unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
* .
* @return 0: success, 1: failure
*/
-static int unit_walktoxy(struct block_list *bl, short x, short y, int flag)
+static int unit_walk_toxy(struct block_list *bl, short x, short y, int flag)
{
// TODO: change flag to enum? [skyleo]
struct unit_data* ud = NULL;
@@ -564,7 +564,7 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag)
if ((flag & 4) != 0 && DIFF_TICK(ud->canmove_tick, timer->gettick()) > 0
&& DIFF_TICK(ud->canmove_tick, timer->gettick()) < 2000) {
// Delay walking command. [Skotlex]
- timer->add(ud->canmove_tick + 1, unit->delay_walktoxy_timer, bl->id,
+ timer->add(ud->canmove_tick + 1, unit->delay_walk_toxy_timer, bl->id,
(intptr_t)MakeDWord((uint16)x, (uint16)y));
return 0;
}
@@ -589,12 +589,12 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag)
if (ud->walktimer != INVALID_TIMER) {
// When you come to the center of the grid because the change of destination while you're walking right now
- // Call a function from a timer unit->walktoxy_sub
+ // Call a function from a timer unit->walk_toxy_sub
ud->state.change_walk_target = 1;
return 0;
}
- return unit->walktoxy_sub(bl);
+ return unit->walk_toxy_sub(bl);
}
/**
@@ -635,7 +635,7 @@ static int unit_walktobl_timer(int tid, int64 tick, int id, intptr_t data)
if (ud->walktimer == INVALID_TIMER && ud->target == data) {
if (DIFF_TICK(ud->canmove_tick, tick) > 0) // Keep waiting?
timer->add(ud->canmove_tick + 1, unit->walktobl_timer, id, data);
- else if (unit->can_move(bl) != 0 && unit->walktoxy_sub(bl) == 0 && ud->state.attack_continue != 0)
+ else if (unit->can_move(bl) != 0 && unit->walk_toxy_sub(bl) == 0 && ud->state.attack_continue != 0)
set_mobstate(bl);
}
return 0;
@@ -694,7 +694,7 @@ static int unit_walktobl(struct block_list *bl, struct block_list *tbl, int rang
if(!unit->can_move(bl))
return 0;
- if (unit->walktoxy_sub(bl) == 0 && (flag & 2) != 0) {
+ if (unit->walk_toxy_sub(bl) == 0 && (flag & 2) != 0) {
set_mobstate(bl);
return 0;
}
@@ -784,14 +784,14 @@ static bool unit_run(struct block_list *bl, struct map_session_data *sd, enum sc
return false;
}
- if (unit->walktoxy(bl, to_x, to_y, 1) == 0)
+ if (unit->walk_toxy(bl, to_x, to_y, 1) == 0)
return true;
//There must be an obstacle nearby. Attempt walking one cell at a time.
do {
to_x -= dir_x;
to_y -= dir_y;
- } while (--i > 0 && unit->walktoxy(bl, to_x, to_y, 1) != 0);
+ } while (--i > 0 && unit->walk_toxy(bl, to_x, to_y, 1) != 0);
if ( i == 0 ) {
unit->run_hit(bl, sc, sd, type);
@@ -809,7 +809,7 @@ static int unit_escape(struct block_list *bl, struct block_list *target, short d
Assert_retr(1, dir >= UNIT_DIR_FIRST && dir < UNIT_DIR_MAX);
while (dist > 0 && map->getcell(bl->m, bl, bl->x + dist * dirx[dir], bl->y + dist * diry[dir], CELL_CHKNOREACH))
dist--;
- if (dist > 0 && unit->walktoxy(bl, bl->x + dist * dirx[dir], bl->y + dist * diry[dir], 0) == 0)
+ if (dist > 0 && unit->walk_toxy(bl, bl->x + dist * dirx[dir], bl->y + dist * diry[dir], 0) == 0)
return 1;
else
return 0;
@@ -885,7 +885,7 @@ static int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int eas
* @param dir: the facing direction @see enum unit_dir
* @return 0: success, 1: failure
*/
-static int unit_setdir(struct block_list *bl, enum unit_dir dir)
+static int unit_set_dir(struct block_list *bl, enum unit_dir dir)
{
nullpo_retr(1, bl);
struct unit_data *ud = unit->bl2ud(bl);
@@ -1075,7 +1075,7 @@ static int unit_stop_walking(struct block_list *bl, int flag)
//timer->delete function does not messes with it. If the function's
//behavior changes in the future, this code could break!
td = timer->get(ud->walktimer);
- timer->delete(ud->walktimer, unit->walktoxy_timer);
+ timer->delete(ud->walktimer, unit->walk_toxy_timer);
ud->walktimer = INVALID_TIMER;
ud->state.change_walk_target = 0;
tick = timer->gettick();
@@ -1083,7 +1083,7 @@ static int unit_stop_walking(struct block_list *bl, int flag)
|| (flag&STOPWALKING_FLAG_NEXTCELL && td && DIFF_TICK(td->tick, tick) <= td->data/2) //Enough time has passed to cover half-cell
) {
ud->walkpath.path_len = ud->walkpath.path_pos+1;
- unit->walktoxy_timer(INVALID_TIMER, tick, bl->id, ud->walkpath.path_pos);
+ unit->walk_toxy_timer(INVALID_TIMER, tick, bl->id, ud->walkpath.path_pos);
}
if(flag&STOPWALKING_FLAG_FIXPOS)
@@ -1515,7 +1515,7 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill
ud->target_to = target_id;
ud->stepskill_id = skill_id;
ud->stepskill_lv = skill_lv;
- return 0; // Attacking will be handled by unit_walktoxy_timer in this case
+ return 0; // Attacking will be handled by unit_walk_toxy_timer in this case
}
//Check range when not using skill on yourself or is a combo-skill during attack
@@ -1728,7 +1728,7 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill
if( casttime > 0 ) {
if (src->id != target->id) // self-targeted skills shouldn't show different direction
- unit->setdir(src, map->calc_dir(src, target->x, target->y));
+ unit->set_dir(src, map->calc_dir(src, target->x, target->y));
ud->skilltimer = timer->add( tick+casttime, skill->castend_id, src->id, 0 );
if (sd && (pc->checkskill(sd, SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0))
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
@@ -1822,7 +1822,7 @@ static int unit_skilluse_pos2(struct block_list *src, short skill_x, short skill
ud->target_to = (skill_x + skill_y*md->xs);
ud->stepskill_id = skill_id;
ud->stepskill_lv = skill_lv;
- return 0; // Attacking will be handled by unit_walktoxy_timer in this case
+ return 0; // Attacking will be handled by unit_walk_toxy_timer in this case
}
if( skill->get_state(ud->skill_id) == ST_MOVE_ENABLE ) {
@@ -1883,7 +1883,7 @@ static int unit_skilluse_pos2(struct block_list *src, short skill_x, short skill
// in official this is triggered even if no cast time.
clif->useskill(src, src->id, 0, skill_x, skill_y, skill_id, skill_lv, casttime);
if( casttime > 0 ) {
- unit->setdir(src, map->calc_dir(src, skill_x, skill_y));
+ unit->set_dir(src, map->calc_dir(src, skill_x, skill_y));
ud->skilltimer = timer->add( tick+casttime, skill->castend_pos, src->id, 0 );
if ((sd && pc->checkskill(sd, SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0) {
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
@@ -1962,7 +1962,7 @@ static void unit_stop_stepaction(struct block_list *bl)
return;
//Clear timer
- timer->delete(ud->steptimer, unit->step_timer);
+ timer->delete(ud->steptimer, unit->steptimer);
ud->steptimer = INVALID_TIMER;
}
@@ -2046,7 +2046,7 @@ static int unit_attack(struct block_list *src, int target_id, int continuous)
ud->target_to = ud->target;
ud->stepskill_id = 0;
ud->stepskill_lv = 0;
- return 0; // Attacking will be handled by unit_walktoxy_timer in this case
+ return 0; // Attacking will be handled by unit_walk_toxy_timer in this case
}
if(DIFF_TICK(ud->attackabletime, timer->gettick()) > 0)
@@ -2336,7 +2336,7 @@ static int unit_attack_timer_sub(struct block_list *src, int tid, int64 tick)
}
if(ud->state.attack_continue) {
- unit->setdir(src, map->calc_dir(src, target->x, target->y));
+ unit->set_dir(src, map->calc_dir(src, target->x, target->y));
if( src->type == BL_PC )
pc->update_idle_time(sd, BCIDLE_ATTACK);
ud->attacktimer = timer->add(ud->attackabletime,unit->attack_timer,src->id,0);
@@ -3033,10 +3033,10 @@ static int do_init_unit(bool minimal)
return 0;
timer->add_func_list(unit->attack_timer, "unit_attack_timer");
- timer->add_func_list(unit->walktoxy_timer,"unit_walktoxy_timer");
+ timer->add_func_list(unit->walk_toxy_timer, "unit_walk_toxy_timer");
timer->add_func_list(unit->walktobl_timer, "unit_walktobl_timer");
- timer->add_func_list(unit->delay_walktoxy_timer,"unit_delay_walktoxy_timer");
- timer->add_func_list(unit->step_timer,"unit_step_timer");
+ timer->add_func_list(unit->delay_walk_toxy_timer, "unit_delay_walk_toxy_timer");
+ timer->add_func_list(unit->steptimer, "unit_steptimer");
return 0;
}
@@ -3057,24 +3057,24 @@ void unit_defaults(void)
unit->bl2ud2 = unit_bl2ud2;
unit->init_ud = unit_init_ud;
unit->attack_timer = unit_attack_timer;
- unit->walktoxy_timer = unit_walktoxy_timer;
- unit->walktoxy_sub = unit_walktoxy_sub;
- unit->delay_walktoxy_timer = unit_delay_walktoxy_timer;
- unit->walktoxy = unit_walktoxy;
+ unit->walk_toxy_timer = unit_walk_toxy_timer;
+ unit->walk_toxy_sub = unit_walk_toxy_sub;
+ unit->delay_walk_toxy_timer = unit_delay_walk_toxy_timer;
+ unit->walk_toxy = unit_walk_toxy;
unit->walktobl_timer = unit_walktobl_timer;
unit->walktobl = unit_walktobl;
unit->run = unit_run;
unit->run_hit = unit_run_hit;
unit->escape = unit_escape;
unit->movepos = unit_movepos;
- unit->setdir = unit_setdir;
+ unit->set_dir = unit_set_dir;
unit->getdir = unit_getdir;
unit->blown = unit_blown;
unit->warp = unit_warp;
unit->warpto_master = unit_warpto_master;
unit->stop_walking = unit_stop_walking;
unit->skilluse_id = unit_skilluse_id;
- unit->step_timer = unit_step_timer;
+ unit->steptimer = unit_steptimer;
unit->stop_stepaction = unit_stop_stepaction;
unit->is_walking = unit_is_walking;
unit->can_move = unit_can_move;
diff --git a/src/map/unit.h b/src/map/unit.h
index dd338d076..57f04b57a 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -106,24 +106,24 @@ struct unit_interface {
struct unit_data* (*bl2ud2) (struct block_list *bl);
void (*init_ud) (struct unit_data *ud);
int (*attack_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*walktoxy_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*walktoxy_sub) (struct block_list *bl);
- int (*delay_walktoxy_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*walktoxy) (struct block_list *bl, short x, short y, int flag);
+ int (*walk_toxy_timer) (int tid, int64 tick, int id, intptr_t data);
+ int (*walk_toxy_sub) (struct block_list *bl);
+ int (*delay_walk_toxy_timer) (int tid, int64 tick, int id, intptr_t data);
+ int (*walk_toxy) (struct block_list *bl, short x, short y, int flag);
int (*walktobl_timer) (int tid, int64 tick, int id, intptr_t data);
int (*walktobl) (struct block_list *bl, struct block_list *tbl, int range, int flag);
bool (*run) (struct block_list *bl, struct map_session_data *sd, enum sc_type type);
void (*run_hit) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type);
int (*escape) (struct block_list *bl, struct block_list *target, short dist);
int (*movepos) (struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
- int (*setdir) (struct block_list *bl, enum unit_dir dir);
+ int (*set_dir) (struct block_list *bl, enum unit_dir dir);
enum unit_dir (*getdir) (struct block_list *bl);
int (*blown) (struct block_list *bl, int dx, int dy, int count, int flag);
int (*warp) (struct block_list *bl, short m, short x, short y, enum clr_type type);
int (*warpto_master) (struct block_list *master_bl, struct block_list *slave_bl);
int (*stop_walking) (struct block_list *bl, int type);
int (*skilluse_id) (struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv);
- int (*step_timer) (int tid, int64 tick, int id, intptr_t data);
+ int (*steptimer) (int tid, int64 tick, int id, intptr_t data);
void (*stop_stepaction) (struct block_list *bl);
int (*is_walking) (struct block_list *bl);
int (*can_move) (struct block_list *bl);