summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2013-12-16 19:25:58 -0800
committerHaruna <haru@dotalux.com>2013-12-16 19:25:58 -0800
commit8b84026c292fed6f6218278c870c4f8839fbd40a (patch)
tree4b62aa52844a1916db1f18faba8b9cf29ff30810 /src/map/unit.c
parent9e223137eba56dcd41bececf4360f321c9117247 (diff)
parent3917562fc493c031bb20181b5d9ae6ab15ce9b76 (diff)
downloadhercules-8b84026c292fed6f6218278c870c4f8839fbd40a.tar.gz
hercules-8b84026c292fed6f6218278c870c4f8839fbd40a.tar.bz2
hercules-8b84026c292fed6f6218278c870c4f8839fbd40a.tar.xz
hercules-8b84026c292fed6f6218278c870c4f8839fbd40a.zip
Merge pull request #237 from HerculesWS/warnings
This adds an Xcode project file (for those who develop on OS X) and fixes several - potential or real - issues we detected thanks to its more strict warnings settings. It also updates the unix build script with similar warning settings.
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 28dd68e7d..7f722684d 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -670,15 +670,15 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
if( sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0 )
{ // Check if pet needs to be teleported. [Skotlex]
int flag = 0;
- struct block_list* bl = &sd->pd->bl;
- if( !checkpath && !path->search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
+ struct block_list* pbl = &sd->pd->bl;
+ if( !checkpath && !path->search(NULL,pbl->m,pbl->x,pbl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
flag = 1;
- else if (!check_distance_bl(&sd->bl, bl, AREA_SIZE)) //Too far, teleport.
+ else if (!check_distance_bl(&sd->bl, pbl, AREA_SIZE)) //Too far, teleport.
flag = 2;
if( flag )
{
- unit->movepos(bl,sd->bl.x,sd->bl.y, 0, 0);
- clif->slide(bl,bl->x,bl->y);
+ unit->movepos(pbl,sd->bl.x,sd->bl.y, 0, 0);
+ clif->slide(pbl,pbl->x,pbl->y);
}
}
}
@@ -720,6 +720,8 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
struct skill_unit* su = NULL;
int nx, ny, result;
+ nullpo_ret(bl);
+
sd = BL_CAST(BL_PC, bl);
su = BL_CAST(BL_SKILL, bl);