summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-27 18:17:24 +0100
committerHaru <haru@dotalux.com>2016-01-06 15:14:49 +0100
commitb3c722ecf777aeeea6317755a6adfc0216b7a2bd (patch)
treec3692ea61faa21307265d7b3e4a09d38854a8d71 /src/map/script.c
parentaa574e36fea903b9aea31ea6f52855498d9476a9 (diff)
downloadhercules-b3c722ecf777aeeea6317755a6adfc0216b7a2bd.tar.gz
hercules-b3c722ecf777aeeea6317755a6adfc0216b7a2bd.tar.bz2
hercules-b3c722ecf777aeeea6317755a6adfc0216b7a2bd.tar.xz
hercules-b3c722ecf777aeeea6317755a6adfc0216b7a2bd.zip
Replaced some explicit casts with BL_UCAST/BL_UCCAST
- Replaced the map-iterator related casts. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 7fc4f6b39..800b58428 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6104,7 +6104,7 @@ BUILDIN(warpguild)
}
iter = mapit_getallusers();
- for (pl_sd = (struct map_session_data *)mapit->first(iter); mapit->exists(iter); pl_sd = (struct map_session_data *)mapit->next(iter)) {
+ for (pl_sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); pl_sd = BL_UCAST(BL_PC, mapit->next(iter))) {
if( pl_sd->status.guild_id != gid )
continue;
@@ -10530,7 +10530,8 @@ BUILDIN(getusers) {
*------------------------------------------*/
BUILDIN(getusersname)
{
- struct map_session_data *sd, *pl_sd;
+ struct map_session_data *sd;
+ const struct map_session_data *pl_sd;
int /*disp_num=1,*/ group_level = 0;
struct s_mapiterator* iter;
@@ -10539,7 +10540,7 @@ BUILDIN(getusersname)
group_level = pc_get_group_level(sd);
iter = mapit_getallusers();
- for (pl_sd = (struct map_session_data *)mapit->first(iter); mapit->exists(iter); pl_sd = (struct map_session_data *)mapit->next(iter)) {
+ for (pl_sd = BL_UCCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); pl_sd = BL_UCCAST(BL_PC, mapit->next(iter))) {
if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > group_level)
continue; // skip hidden sessions
@@ -11884,7 +11885,7 @@ BUILDIN(pvpon)
return true;
iter = mapit_getallusers();
- for (sd = (struct map_session_data *)mapit->first(iter); mapit->exists(iter); sd = (struct map_session_data *)mapit->next(iter)) {
+ for (sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) {
if( sd->bl.m != m || sd->pvp_timer != INVALID_TIMER )
continue; // not applicable
@@ -13605,7 +13606,7 @@ BUILDIN(recovery)
struct s_mapiterator* iter;
iter = mapit_getallusers();
- for (sd = (struct map_session_data *)mapit->first(iter); mapit->exists(iter); sd = (struct map_session_data *)mapit->next(iter)) {
+ for (sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) {
if(pc_isdead(sd))
status->revive(&sd->bl, 100, 100);
else