summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/atcommand.c10
-rw-r--r--src/map/battle.c12
-rw-r--r--src/map/battleground.c6
-rw-r--r--src/map/chat.c16
-rw-r--r--src/map/clif.c306
-rw-r--r--src/map/guild.c56
-rw-r--r--src/map/homunculus.c14
-rw-r--r--src/map/intif.c8
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/log.c14
-rw-r--r--src/map/mail.c6
-rw-r--r--src/map/map.c14
-rw-r--r--src/map/mob.c54
-rw-r--r--src/map/npc.c38
-rw-r--r--src/map/party.c14
-rw-r--r--src/map/pc.c154
-rw-r--r--src/map/pet.c16
-rw-r--r--src/map/quest.c4
-rw-r--r--src/map/skill.c134
-rw-r--r--src/map/status.c26
-rw-r--r--src/map/storage.c34
-rw-r--r--src/map/unit.c44
22 files changed, 492 insertions, 492 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index eb1632b26..9fe589e73 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2569,7 +2569,7 @@ static int atkillmonster_sub(struct block_list *bl, va_list ap)
struct mob_data *md;
int flag;
- nullpo_retr(0, md=(struct mob_data *)bl);
+ nullpo_ret(md=(struct mob_data *)bl);
flag = va_arg(ap, int);
if (md->guardian_data)
@@ -6338,7 +6338,7 @@ int atcommand_mobsearch(const int fd, struct map_session_data* sd, const char* c
*------------------------------------------*/
static int atcommand_cleanmap_sub(struct block_list *bl, va_list ap)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
map_clearflooritem(bl->id);
return 0;
@@ -6860,7 +6860,7 @@ int atcommand_misceffect(const int fd, struct map_session_data* sd, const char*
*------------------------------------------*/
int atcommand_mail(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
mail_openmail(sd);
#endif
@@ -7576,7 +7576,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
int atcommand_mutearea(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int time;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!message || !*message) {
clif_displaymessage(fd, "Please, enter a time in minutes (usage: @mutearea/@stfu <time in minutes>.");
@@ -8144,7 +8144,7 @@ int atcommand_feelreset(const int fd, struct map_session_data* sd, const char* c
*------------------------------------------*/
int atcommand_auction(const int fd, struct map_session_data *sd, const char *command, const char *message)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
clif_Auction_openwindow(sd);
diff --git a/src/map/battle.c b/src/map/battle.c
index c5a1f4272..2a7b4de18 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -179,8 +179,8 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
{
struct delay_damage *dat;
struct status_change *sc;
- nullpo_retr(0, src);
- nullpo_retr(0, target);
+ nullpo_ret(src);
+ nullpo_ret(target);
sc = status_get_sc(target);
if( sc && sc->data[SC_DEVOTION] && damage > 0 )
@@ -278,7 +278,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
struct status_change_entry *sce;
int div_ = d->div_, flag = d->flag;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if( !damage )
return 0;
@@ -713,7 +713,7 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
int weapon;
damage = dmg;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if((skill = pc_checkskill(sd,AL_DEMONBANE)) > 0 &&
target->type == BL_MOB && //This bonus doesnt work against players.
@@ -3331,8 +3331,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
int strip_enemy = 1; //Flag which marks whether to remove the BCT_ENEMY status if it's also friend/ally.
struct block_list *s_bl = src, *t_bl = target;
- nullpo_retr(0, src);
- nullpo_retr(0, target);
+ nullpo_ret(src);
+ nullpo_ret(target);
m = target->m;
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 40fe2a0c6..fad22c38f 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -173,7 +173,7 @@ int bg_create(unsigned short mapindex, short rx, short ry, const char *ev, const
int bg_team_get_id(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch( bl->type )
{
case BL_PC:
@@ -209,7 +209,7 @@ int bg_send_message(struct map_session_data *sd, const char *mes, int len)
{
struct battleground_data *bg;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->state.bg_id == 0 || (bg = bg_team_search(sd->state.bg_id)) == NULL )
return 0;
clif_bg_message(bg, sd->status.name, mes, len);
@@ -221,7 +221,7 @@ int bg_send_xy_timer_sub(DBKey key, void *data, va_list ap)
struct battleground_data *bg = (struct battleground_data *)data;
struct map_session_data *sd;
int i;
- nullpo_retr(0, bg);
+ nullpo_ret(bg);
for( i = 0; i < MAX_BG_MEMBERS; i++ )
{
if( (sd = bg->members[i].sd) == NULL )
diff --git a/src/map/chat.c b/src/map/chat.c
index 7306c70cf..96ec4c20d 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -64,7 +64,7 @@ static struct chat_data* chat_createchat(struct block_list* bl, const char* titl
int chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
{
struct chat_data* cd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->chatID )
return 0; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
@@ -105,7 +105,7 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
{
struct chat_data* cd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
cd = (struct chat_data*)map_id2bl(chatid);
if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->vender_id || sd->chatID || cd->users >= cd->limit )
@@ -297,7 +297,7 @@ int chat_kickchat(struct map_session_data* sd, const char* kickusername)
int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev)
{
struct chat_data* cd;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
if( nd->chat_id )
{
@@ -319,7 +319,7 @@ int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool p
int chat_deletenpcchat(struct npc_data* nd)
{
struct chat_data *cd;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
cd = (struct chat_data*)map_id2bl(nd->chat_id);
if( cd == NULL )
@@ -340,7 +340,7 @@ int chat_deletenpcchat(struct npc_data* nd)
*------------------------------------------*/
int chat_triggerevent(struct chat_data *cd)
{
- nullpo_retr(0, cd);
+ nullpo_ret(cd);
if( cd->users >= cd->trigger && cd->npc_event[0] )
npc_event_do(cd->npc_event);
@@ -351,7 +351,7 @@ int chat_triggerevent(struct chat_data *cd)
/// At most, 127 users are needed to trigger the event.
int chat_enableevent(struct chat_data* cd)
{
- nullpo_retr(0, cd);
+ nullpo_ret(cd);
cd->trigger &= 0x7f;
chat_triggerevent(cd);
@@ -361,7 +361,7 @@ int chat_enableevent(struct chat_data* cd)
/// Disables the event of the chat room
int chat_disableevent(struct chat_data* cd)
{
- nullpo_retr(0, cd);
+ nullpo_ret(cd);
cd->trigger |= 0x80;
return 0;
@@ -370,7 +370,7 @@ int chat_disableevent(struct chat_data* cd)
/// Kicks all the users from the chat room.
int chat_npckickall(struct chat_data* cd)
{
- nullpo_retr(0, cd);
+ nullpo_ret(cd);
while( cd->users > 0 )
chat_leavechat(cd->usersd[cd->users-1],0);
diff --git a/src/map/clif.c b/src/map/clif.c
index d003a7048..250220931 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -189,8 +189,8 @@ int clif_send_sub(struct block_list *bl, va_list ap)
unsigned char *buf;
int len, type, fd;
- nullpo_retr(0, bl);
- nullpo_retr(0, sd = (struct map_session_data *)bl);
+ nullpo_ret(bl);
+ nullpo_ret(sd = (struct map_session_data *)bl);
fd = sd->fd;
if (!fd) //Don't send to disconnected clients.
@@ -198,7 +198,7 @@ int clif_send_sub(struct block_list *bl, va_list ap)
buf = va_arg(ap,unsigned char*);
len = va_arg(ap,int);
- nullpo_retr(0, src_bl = va_arg(ap,struct block_list*));
+ nullpo_ret(src_bl = va_arg(ap,struct block_list*));
type = va_arg(ap,int);
switch(type)
@@ -256,7 +256,7 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
struct s_mapiterator* iter;
if( type != ALL_CLIENT && type != CHAT_MAINCHAT )
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sd = BL_CAST(BL_PC, bl);
@@ -606,7 +606,7 @@ int clif_dropflooritem(struct flooritem_data* fitem)
uint8 buf[17];
int view;
- nullpo_retr(0, fitem);
+ nullpo_ret(fitem);
if (fitem->item_data.nameid <= 0)
return 0;
@@ -633,7 +633,7 @@ int clif_clearflooritem(struct flooritem_data *fitem, int fd)
{
unsigned char buf[16];
- nullpo_retr(0, fitem);
+ nullpo_ret(fitem);
WBUFW(buf,0) = 0xa1;
WBUFL(buf,2) = fitem->bl.id;
@@ -680,7 +680,7 @@ int clif_clearunit_area(struct block_list* bl, uint8 type)
{
unsigned char buf[16];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x80;
WBUFL(buf,2) = bl->id;
@@ -1035,7 +1035,7 @@ int clif_class_change(struct block_list *bl,int class_,int type)
{
unsigned char buf[16];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(!pcdb_checkid(class_)) {
WBUFW(buf,0)=0x1b0;
@@ -1186,7 +1186,7 @@ int clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
struct status_data *status;
unsigned char buf[128];
- nullpo_retr(0, hd);
+ nullpo_ret(hd);
status = &hd->battle_status;
memset(buf,0,packet_len(0x22e));
@@ -1496,7 +1496,7 @@ int clif_npcbuysell(struct map_session_data* sd, int id)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xc4));
@@ -1514,8 +1514,8 @@ int clif_buylist(struct map_session_data *sd, struct npc_data *nd)
{
int fd,i,c;
- nullpo_retr(0, sd);
- nullpo_retr(0, nd);
+ nullpo_ret(sd);
+ nullpo_ret(nd);
fd = sd->fd;
WFIFOHEAD(fd, 4 + nd->u.shop.count * 11);
@@ -1550,7 +1550,7 @@ int clif_selllist(struct map_session_data *sd)
{
int fd,i,c=0,val;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, MAX_INVENTORY * 10 + 4);
@@ -1614,7 +1614,7 @@ int clif_scriptnext(struct map_session_data *sd,int npcid)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xb5));
@@ -1642,7 +1642,7 @@ int clif_scriptclose(struct map_session_data *sd, int npcid)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xb6));
@@ -1733,7 +1733,7 @@ int clif_scriptinput(struct map_session_data *sd, int npcid)
int fd;
struct block_list *bl = NULL;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
@@ -1763,7 +1763,7 @@ int clif_scriptinputstr(struct map_session_data *sd, int npcid)
int fd;
struct block_list *bl = NULL;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
@@ -1786,7 +1786,7 @@ int clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x144));
@@ -1809,7 +1809,7 @@ int clif_cutin(struct map_session_data* sd, const char* image, int type)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x1b3));
@@ -1885,7 +1885,7 @@ int clif_additem(struct map_session_data *sd, int n, int amount, int fail)
#else
const int cmd = 0x2d4;
#endif
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if( !session_isActive(fd) ) //Sasuke-
@@ -1950,7 +1950,7 @@ int clif_dropitem(struct map_session_data *sd,int n,int amount)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0xaf));
@@ -1981,7 +1981,7 @@ int clif_delitem(struct map_session_data *sd,int n,int amount, short reason)
#else
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (reason == 7)
return clif_dropitem(sd,n,amount);
@@ -2417,7 +2417,7 @@ int clif_guild_xy(struct map_session_data *sd)
{
unsigned char buf[10];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x1eb;
WBUFL(buf,2)=sd->status.account_id;
@@ -2450,7 +2450,7 @@ int clif_guild_xy_remove(struct map_session_data *sd)
{
unsigned char buf[10];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x1eb;
WBUFL(buf,2)=sd->status.account_id;
@@ -2469,7 +2469,7 @@ int clif_updatestatus(struct map_session_data *sd,int type)
{
int fd,len=8;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
@@ -2681,7 +2681,7 @@ int clif_changestatus(struct block_list *bl,int type,int val)
unsigned char buf[12];
struct map_session_data *sd = NULL;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(bl->type == BL_PC)
sd = (struct map_session_data *)bl;
@@ -2866,7 +2866,7 @@ int clif_initialstatus(struct map_session_data *sd)
int fd;
unsigned char *buf;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xbd));
@@ -2927,7 +2927,7 @@ int clif_arrowequip(struct map_session_data *sd,int val)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
pc_stop_attack(sd); // [Valaris]
@@ -2951,7 +2951,7 @@ int clif_arrow_fail(struct map_session_data *sd,int type)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x013b));
@@ -2970,7 +2970,7 @@ int clif_arrow_create_list(struct map_session_data *sd)
int i, c, j;
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
WFIFOHEAD(fd, MAX_SKILL_ARROW_DB*2+4);
@@ -3005,7 +3005,7 @@ int clif_statusupack(struct map_session_data *sd,int type,int ok,int val)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xbc));
@@ -3025,7 +3025,7 @@ int clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xaa));
@@ -3053,7 +3053,7 @@ int clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xac));
@@ -3073,7 +3073,7 @@ int clif_misceffect(struct block_list* bl,int type)
{
unsigned char buf[32];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x19b;
WBUFL(buf,2) = bl->id;
@@ -3087,7 +3087,7 @@ int clif_misceffect2(struct block_list *bl, int type)
{
unsigned char buf[24];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
memset(buf, 0, packet_len(0x1f3));
@@ -3109,7 +3109,7 @@ int clif_changeoption(struct block_list* bl)
struct status_change *sc;
struct map_session_data* sd;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sc = status_get_sc(bl);
if (!sc) return 0; //How can an option change if there's no sc?
sd = BL_CAST(BL_PC, bl);
@@ -3181,7 +3181,7 @@ int clif_changeoption2(struct block_list* bl)
*------------------------------------------*/
int clif_useitemack(struct map_session_data *sd,int index,int amount,int ok)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!ok) {
int fd=sd->fd;
@@ -3306,7 +3306,7 @@ int clif_clearchat(struct chat_data *cd,int fd)
{
unsigned char buf[32];
- nullpo_retr(0, cd);
+ nullpo_ret(cd);
WBUFW(buf,0) = 0xd8;
WBUFL(buf,2) = cd->bl.id;
@@ -3328,7 +3328,7 @@ int clif_joinchatfail(struct map_session_data *sd,int fail)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
@@ -3348,8 +3348,8 @@ int clif_joinchatok(struct map_session_data *sd,struct chat_data* cd)
int fd;
int i;
- nullpo_retr(0, sd);
- nullpo_retr(0, cd);
+ nullpo_ret(sd);
+ nullpo_ret(cd);
fd = sd->fd;
if (!session_isActive(fd))
@@ -3374,8 +3374,8 @@ int clif_addchat(struct chat_data* cd,struct map_session_data *sd)
{
unsigned char buf[32];
- nullpo_retr(0, sd);
- nullpo_retr(0, cd);
+ nullpo_ret(sd);
+ nullpo_ret(cd);
WBUFW(buf, 0) = 0x0dc;
WBUFW(buf, 2) = cd->users;
@@ -3899,8 +3899,8 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
unsigned char buf[256];
struct status_change *sc;
- nullpo_retr(0, src);
- nullpo_retr(0, dst);
+ nullpo_ret(src);
+ nullpo_ret(dst);
type = clif_calc_delay(type,div,damage+damage2,ddelay);
sc = status_get_sc(dst);
@@ -4151,7 +4151,7 @@ void clif_01ac(struct block_list* bl)
{
struct map_session_data *sd;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sd=va_arg(ap,struct map_session_data*);
@@ -4264,7 +4264,7 @@ int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range)
{
int fd,id;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
if( (id=sd->status.skill[skillid].id) <= 0 )
@@ -4301,7 +4301,7 @@ int clif_skillinfoblock(struct map_session_data *sd)
int fd;
int i,len,id;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
if (!fd) return 0;
@@ -4339,7 +4339,7 @@ int clif_addskill(struct map_session_data *sd, int id )
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if (!fd) return 0;
@@ -4373,7 +4373,7 @@ int clif_deleteskill(struct map_session_data *sd, int id)
#if PACKETVER >= 20081217
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if( !fd ) return 0;
@@ -4394,7 +4394,7 @@ int clif_skillup(struct map_session_data *sd,int skill_num)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x10e));
@@ -4441,7 +4441,7 @@ int clif_skillcastcancel(struct block_list* bl)
{
unsigned char buf[16];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x1b9;
WBUFL(buf,2) = bl->id;
@@ -4526,7 +4526,7 @@ int clif_skill_cooldown(struct map_session_data *sd, int skillid, unsigned int t
#if PACKETVER>=20081112
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x043d));
@@ -4547,8 +4547,8 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
unsigned char buf[64];
struct status_change *sc;
- nullpo_retr(0, src);
- nullpo_retr(0, dst);
+ nullpo_ret(src);
+ nullpo_ret(dst);
type = clif_calc_delay(type,div,damage,ddelay);
sc = status_get_sc(dst);
@@ -4634,8 +4634,8 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned in
unsigned char buf[64];
struct status_change *sc;
- nullpo_retr(0, src);
- nullpo_retr(0, dst);
+ nullpo_ret(src);
+ nullpo_ret(dst);
type = (type>0)?type:skill_get_hit(skill_id);
type = clif_calc_delay(type,div,damage,ddelay);
@@ -4691,7 +4691,7 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst,int skill_
{
unsigned char buf[32];
- nullpo_retr(0, dst);
+ nullpo_ret(dst);
WBUFW(buf,0)=0x11a;
WBUFW(buf,2)=skill_id;
@@ -4724,7 +4724,7 @@ int clif_skill_poseffect(struct block_list *src,int skill_id,int val,int x,int y
{
unsigned char buf[32];
- nullpo_retr(0, src);
+ nullpo_ret(src);
WBUFW(buf,0)=0x117;
WBUFW(buf,2)=skill_id;
@@ -4857,8 +4857,8 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
unsigned char buf[64];
int i;//, fix;
- nullpo_retr(0, sd);
- nullpo_retr(0, dst);
+ nullpo_ret(sd);
+ nullpo_ret(dst);
if( dst->type != BL_MOB )
return 0;
@@ -4890,7 +4890,7 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger)
{
int i,c,view,fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->menuskill_id == AM_PHARMACY)
return 0; //Avoid resending the menu twice or more times...
@@ -4992,7 +4992,7 @@ int clif_status_change(struct block_list *bl,int type,int flag,unsigned int tick
if (type == SI_BLANK) //It shows nothing on the client...
return 0;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (type == SI_BLANK || type == SI_MAXIMIZEPOWER || type == SI_RIDING ||
type == SI_FALCON || type == SI_TRICKDEAD || type == SI_BROKENARMOR ||
@@ -5164,7 +5164,7 @@ int clif_resurrection(struct block_list *bl,int type)
{
unsigned char buf[16];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0)=0x148;
WBUFL(buf,2)=bl->id;
@@ -5354,7 +5354,7 @@ int clif_use_card(struct map_session_data *sd,int idx)
int i,c,ep;
int fd=sd->fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (idx < 0 || idx >= MAX_INVENTORY) //Crash-fix from bad packets.
return 0;
@@ -5403,7 +5403,7 @@ int clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x17d));
@@ -5423,7 +5423,7 @@ int clif_item_identify_list(struct map_session_data *sd)
int i,c;
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
@@ -5451,7 +5451,7 @@ int clif_item_identified(struct map_session_data *sd,int idx,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x179));
@@ -5471,8 +5471,8 @@ int clif_item_repair_list(struct map_session_data *sd,struct map_session_data *d
int fd;
int nameid;
- nullpo_retr(0, sd);
- nullpo_retr(0, dstsd);
+ nullpo_ret(sd);
+ nullpo_ret(dstsd);
fd=sd->fd;
@@ -5502,7 +5502,7 @@ int clif_item_repaireffect(struct map_session_data *sd,int nameid,int flag)
{
int view,fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x1fe));
@@ -5528,7 +5528,7 @@ int clif_item_refine_list(struct map_session_data *sd)
int wlv;
int refine_item[5];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
skilllv = pc_checkskill(sd,WS_WEAPONREFINE);
@@ -5569,7 +5569,7 @@ int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x147));
@@ -5594,7 +5594,7 @@ int clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
int view,fd;
unsigned char *buf;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
if(n<0 || n>=MAX_CART || sd->status.cart[n].nameid<=0)
@@ -5643,7 +5643,7 @@ int clif_cart_delitem(struct map_session_data *sd,int n,int amount)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
@@ -5855,7 +5855,7 @@ int clif_party_created(struct map_session_data *sd,int result)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xfa));
@@ -5904,7 +5904,7 @@ int clif_party_info(struct party_data* p, struct map_session_data *sd)
struct map_session_data* party_sd = NULL;
int i, c;
- nullpo_retr(0, p);
+ nullpo_ret(p);
WBUFW(buf,0) = 0xfb;
memcpy(WBUFP(buf,4), p->party.name, NAME_LENGTH);
@@ -5957,8 +5957,8 @@ int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd)
int fd;
struct party_data *p;
- nullpo_retr(0, sd);
- nullpo_retr(0, tsd);
+ nullpo_ret(sd);
+ nullpo_ret(tsd);
fd=tsd->fd;
@@ -6020,7 +6020,7 @@ int clif_party_option(struct party_data *p,struct map_session_data *sd,int flag)
const int cmd = 0x7d8;
#endif
- nullpo_retr(0, p);
+ nullpo_ret(p);
if(!sd && flag==0){
int i;
@@ -6051,7 +6051,7 @@ int clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int a
unsigned char buf[64];
int i;
- nullpo_retr(0, p);
+ nullpo_ret(p);
if(!sd && (flag&0xf0)==0)
{
@@ -6081,7 +6081,7 @@ int clif_party_message(struct party_data* p, int account_id, const char* mes, in
struct map_session_data *sd;
int i;
- nullpo_retr(0, p);
+ nullpo_ret(p);
for(i=0; i < MAX_PARTY && !p->data[i].sd;i++);
if(i < MAX_PARTY){
@@ -6102,7 +6102,7 @@ int clif_party_xy(struct map_session_data *sd)
{
unsigned char buf[16];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x107;
WBUFL(buf,2)=sd->status.account_id;
@@ -6140,7 +6140,7 @@ int clif_party_hp(struct map_session_data *sd)
const int cmd = 0x80e;
#endif
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=cmd;
WBUFL(buf,2)=sd->status.account_id;
@@ -6205,8 +6205,8 @@ int clif_hpmeter_sub(struct block_list *bl, va_list ap)
sd = va_arg(ap, struct map_session_data *);
tsd = (TBL_PC *)bl;
- nullpo_retr(0, sd);
- nullpo_retr(0, tsd);
+ nullpo_ret(sd);
+ nullpo_ret(tsd);
if( !tsd->fd || tsd == sd )
return 0;
@@ -6238,7 +6238,7 @@ int clif_hpmeter_sub(struct block_list *bl, va_list ap)
*------------------------------------------*/
int clif_hpmeter(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( battle_config.disp_hpmeter )
map_foreachinarea(clif_hpmeter_sub, sd->bl.m, sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE, sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd);
@@ -6274,8 +6274,8 @@ int clif_movetoattack(struct map_session_data *sd,struct block_list *bl)
{
int fd;
- nullpo_retr(0, sd);
- nullpo_retr(0, bl);
+ nullpo_ret(sd);
+ nullpo_ret(bl);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x139));
@@ -6296,7 +6296,7 @@ int clif_produceeffect(struct map_session_data* sd,int flag,int nameid)
{
int view,fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
clif_solved_charname(fd, sd->status.char_id, sd->status.name);
@@ -6316,7 +6316,7 @@ int clif_catch_process(struct map_session_data *sd)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x19e));
@@ -6329,7 +6329,7 @@ int clif_pet_roulette(struct map_session_data *sd,int data)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x1a0));
@@ -6348,7 +6348,7 @@ int clif_sendegg(struct map_session_data *sd)
//R 01a6 <len>.w <index>.w*
int i,n=0,fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
if (battle_config.pet_no_gvg && map_flag_gvg(sd->bl.m))
@@ -6389,7 +6389,7 @@ int clif_sendegg(struct map_session_data *sd)
int clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param)
{
uint8 buf[16];
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
WBUFW(buf,0) = 0x1a4;
WBUFB(buf,2) = type;
@@ -6407,8 +6407,8 @@ int clif_send_petstatus(struct map_session_data *sd)
int fd;
struct s_pet *pet;
- nullpo_retr(0, sd);
- nullpo_retr(0, sd->pd);
+ nullpo_ret(sd);
+ nullpo_ret(sd->pd);
fd=sd->fd;
pet = &sd->pd->pet;
@@ -6435,7 +6435,7 @@ int clif_pet_emotion(struct pet_data *pd,int param)
{
unsigned char buf[16];
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
memset(buf,0,packet_len(0x1aa));
@@ -6460,7 +6460,7 @@ int clif_pet_food(struct map_session_data *sd,int foodid,int fail)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x1a3));
@@ -6479,7 +6479,7 @@ int clif_autospell(struct map_session_data *sd,int skilllv)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x1cd));
@@ -6567,7 +6567,7 @@ int clif_spiritball(struct map_session_data *sd)
{
unsigned char buf[16];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x1d0;
WBUFL(buf,2)=sd->bl.id;
@@ -6583,7 +6583,7 @@ int clif_combo_delay(struct block_list *bl,int wait)
{
unsigned char buf[32];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0)=0x1d2;
WBUFL(buf,2)=bl->id;
@@ -6616,7 +6616,7 @@ int clif_mvp_effect(struct map_session_data *sd)
{
unsigned char buf[16];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x10c;
WBUFL(buf,2)=sd->bl.id;
@@ -6630,7 +6630,7 @@ int clif_mvp_item(struct map_session_data *sd,int nameid)
{
int view,fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x10a));
@@ -6649,7 +6649,7 @@ int clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x10b));
@@ -6671,7 +6671,7 @@ int clif_guild_created(struct map_session_data *sd,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x167));
@@ -6686,8 +6686,8 @@ int clif_guild_created(struct map_session_data *sd,int flag)
int clif_guild_belonginfo(struct map_session_data *sd, struct guild *g)
{
int ps,fd;
- nullpo_retr(0, sd);
- nullpo_retr(0, g);
+ nullpo_ret(sd);
+ nullpo_ret(g);
fd=sd->fd;
ps=guild_getposition(g,sd);
@@ -6708,7 +6708,7 @@ int clif_guild_memberlogin_notice(struct guild *g,int idx,int flag)
{
unsigned char buf[64];
- nullpo_retr(0, g);
+ nullpo_ret(g);
WBUFW(buf, 0)=0x16d;
WBUFL(buf, 2)=g->member[idx].account_id;
@@ -6738,7 +6738,7 @@ int clif_guild_send_onlineinfo(struct map_session_data *sd)
unsigned char buf[14*128];
int i, count=0, p_len;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
p_len = packet_len(0x16d);
@@ -6770,7 +6770,7 @@ int clif_guild_masterormember(struct map_session_data *sd)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x14e));
@@ -6788,7 +6788,7 @@ int clif_guild_basicinfo(struct map_session_data *sd)
struct guild *g;
struct guild_castle *gc = NULL;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if( (g = guild_search(sd->status.guild_id)) == NULL )
@@ -6830,7 +6830,7 @@ int clif_guild_allianceinfo(struct map_session_data *sd)
int fd,i,c;
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g = guild_search(sd->status.guild_id)) == NULL )
return 0;
@@ -6859,7 +6859,7 @@ int clif_guild_memberlist(struct map_session_data *sd)
int fd;
int i,c;
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (fd = sd->fd) == 0 )
return 0;
@@ -6898,7 +6898,7 @@ int clif_guild_positionnamelist(struct map_session_data *sd)
int i,fd;
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g = guild_search(sd->status.guild_id)) == NULL )
return 0;
@@ -6921,7 +6921,7 @@ int clif_guild_positioninfolist(struct map_session_data *sd)
int i,fd;
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g = guild_search(sd->status.guild_id)) == NULL )
return 0;
@@ -6947,7 +6947,7 @@ int clif_guild_positionchanged(struct guild *g,int idx)
struct map_session_data *sd;
unsigned char buf[128];
- nullpo_retr(0, g);
+ nullpo_ret(g);
WBUFW(buf, 0)=0x174;
WBUFW(buf, 2)=44;
@@ -6968,7 +6968,7 @@ int clif_guild_memberpositionchanged(struct guild *g,int idx)
struct map_session_data *sd;
unsigned char buf[64];
- nullpo_retr(0, g);
+ nullpo_ret(g);
WBUFW(buf, 0)=0x156;
WBUFW(buf, 2)=16;
@@ -6985,8 +6985,8 @@ int clif_guild_memberpositionchanged(struct guild *g,int idx)
int clif_guild_emblem(struct map_session_data *sd,struct guild *g)
{
int fd;
- nullpo_retr(0, sd);
- nullpo_retr(0, g);
+ nullpo_ret(sd);
+ nullpo_ret(g);
fd = sd->fd;
if( g->emblem_len <= 0 )
@@ -7027,7 +7027,7 @@ int clif_guild_skillinfo(struct map_session_data* sd)
struct guild* g;
int i,c;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g = guild_search(sd->status.guild_id)) == NULL )
return 0;
@@ -7065,8 +7065,8 @@ int clif_guild_notice(struct map_session_data* sd, struct guild* g)
{
int fd;
- nullpo_retr(0, sd);
- nullpo_retr(0, g);
+ nullpo_ret(sd);
+ nullpo_ret(g);
fd = sd->fd;
@@ -7091,8 +7091,8 @@ int clif_guild_invite(struct map_session_data *sd,struct guild *g)
{
int fd;
- nullpo_retr(0, sd);
- nullpo_retr(0, g);
+ nullpo_ret(sd);
+ nullpo_ret(g);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x16a));
@@ -7109,7 +7109,7 @@ int clif_guild_inviteack(struct map_session_data *sd,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x169));
@@ -7126,7 +7126,7 @@ int clif_guild_leave(struct map_session_data *sd,const char *name,const char *me
{
unsigned char buf[128];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf, 0)=0x15a;
memcpy(WBUFP(buf, 2),name,NAME_LENGTH);
@@ -7142,7 +7142,7 @@ int clif_guild_expulsion(struct map_session_data *sd,const char *name,const char
{
unsigned char buf[128];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf, 0)=0x15c;
safestrncpy((char*)WBUFP(buf, 2),name,NAME_LENGTH);
@@ -7161,7 +7161,7 @@ int clif_guild_expulsionlist(struct map_session_data *sd)
int i,c;
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g = guild_search(sd->status.guild_id)) == NULL )
return 0;
@@ -7210,7 +7210,7 @@ int clif_guild_skillup(struct map_session_data *sd,int skill_num,int lv)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,11);
@@ -7230,7 +7230,7 @@ int clif_guild_reqalliance(struct map_session_data *sd,int account_id,const char
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x171));
@@ -7253,7 +7253,7 @@ int clif_guild_allianceack(struct map_session_data *sd,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x173));
@@ -7269,7 +7269,7 @@ int clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if (fd <= 0)
@@ -7288,7 +7288,7 @@ int clif_guild_oppositionack(struct map_session_data *sd,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x181));
@@ -7318,7 +7318,7 @@ int clif_guild_broken(struct map_session_data *sd,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x15e));
@@ -7443,7 +7443,7 @@ void clif_parse_ReqMarriage(int fd, struct map_session_data *sd)
int clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
if (!fd || !len) return 0; //Disconnected player.
WFIFOHEAD(fd, len+5);
@@ -7475,7 +7475,7 @@ int clif_GM_kickack(struct map_session_data *sd, int id)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xcd));
@@ -7543,7 +7543,7 @@ int clif_wisexin(struct map_session_data *sd,int type,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xd1));
@@ -7561,7 +7561,7 @@ int clif_wisall(struct map_session_data *sd,int type,int flag)
{
int fd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0xd2));
@@ -7618,7 +7618,7 @@ int clif_soundeffectall(struct block_list* bl, const char* name, int type, enum
{
unsigned char buf[40];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x1d3;
safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
@@ -7635,7 +7635,7 @@ int clif_specialeffect(struct block_list* bl, int type, enum send_target target)
{
unsigned char buf[24];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
memset(buf, 0, packet_len(0x1f3));
@@ -7671,7 +7671,7 @@ int clif_messagecolor(struct block_list* bl, unsigned long color, const char* ms
uint8 buf[256];
color = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16; // RGB to BGR
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x2C1;
WBUFW(buf,2) = msg_len + 12;
@@ -7690,7 +7690,7 @@ int clif_message(struct block_list* bl, const char* msg)
unsigned short msg_len = strlen(msg) + 1;
uint8 buf[256];
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = 0x8d;
WBUFW(buf,2) = msg_len + 8;
@@ -7756,7 +7756,7 @@ int clif_charnameack (int fd, struct block_list *bl)
unsigned char buf[103];
int cmd = 0x95, i, ps = -1;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
WBUFW(buf,0) = cmd;
WBUFL(buf,2) = bl->id;
@@ -7823,7 +7823,7 @@ int clif_charnameack (int fd, struct block_list *bl)
case BL_MOB:
{
struct mob_data *md = (struct mob_data *)bl;
- nullpo_retr(0, md);
+ nullpo_ret(md);
memcpy(WBUFP(buf,6), md->name, NAME_LENGTH);
if( md->guardian_data && md->guardian_data->guild_id )
@@ -7885,7 +7885,7 @@ int clif_charnameupdate (struct map_session_data *ssd)
struct party_data *p = NULL;
struct guild *g = NULL;
- nullpo_retr(0, ssd);
+ nullpo_ret(ssd);
if (strlen(ssd->fakename)>1)
return 0; //No need to update as the party/guild was not displayed anyway.
@@ -7978,7 +7978,7 @@ int clif_disp_overhead(struct map_session_data *sd, const char* mes)
int clif_party_xy_remove(struct map_session_data *sd)
{
unsigned char buf[16];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x107;
WBUFL(buf,2)=sd->status.account_id;
WBUFW(buf,6)=-1;
@@ -13643,7 +13643,7 @@ int clif_bg_hp(struct map_session_data *sd)
#else
const int cmd = 0x80e;
#endif
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=cmd;
WBUFL(buf,2) = sd->status.account_id;
@@ -13669,7 +13669,7 @@ int clif_bg_hp(struct map_session_data *sd)
int clif_bg_xy(struct map_session_data *sd)
{
unsigned char buf[10];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x1eb;
WBUFL(buf,2)=sd->status.account_id;
@@ -13682,7 +13682,7 @@ int clif_bg_xy(struct map_session_data *sd)
int clif_bg_xy_remove(struct map_session_data *sd)
{
unsigned char buf[10];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
WBUFW(buf,0)=0x1eb;
WBUFL(buf,2)=sd->status.account_id;
@@ -13763,7 +13763,7 @@ int clif_bg_updatescore(int m)
int clif_bg_updatescore_single(struct map_session_data *sd)
{
int fd;
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
fd = sd->fd;
WFIFOHEAD(fd,6);
@@ -13777,7 +13777,7 @@ int clif_bg_updatescore_single(struct map_session_data *sd)
int clif_sendbgemblem_area(struct map_session_data *sd)
{
unsigned char buf[33];
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
WBUFW(buf, 0) = 0x2dd;
WBUFL(buf,2) = sd->bl.id;
@@ -13789,7 +13789,7 @@ int clif_sendbgemblem_area(struct map_session_data *sd)
int clif_sendbgemblem_single(int fd, struct map_session_data *sd)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
WFIFOHEAD(fd,32);
WFIFOW(fd,0) = 0x2dd;
WFIFOL(fd,2) = sd->bl.id;
@@ -13806,7 +13806,7 @@ int clif_sendbgemblem_single(int fd, struct map_session_data *sd)
int clif_font(struct map_session_data *sd)
{
unsigned char buf[8];
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
WBUFW(buf,0) = 0x2ef;
WBUFL(buf,2) = sd->bl.id;
WBUFW(buf,6) = sd->state.user_font;
diff --git a/src/map/guild.c b/src/map/guild.c
index dbb59c334..73d209653 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -368,7 +368,7 @@ int guild_send_xy_timer_sub(DBKey key,void *data,va_list ap)
struct guild *g=(struct guild *)data;
int i;
- nullpo_retr(0, g);
+ nullpo_ret(g);
for(i=0;i<g->max_member;i++){
//struct map_session_data* sd = g->member[i].sd;
@@ -402,7 +402,7 @@ int guild_create(struct map_session_data *sd, const char *name)
{
char tname[NAME_LENGTH];
struct guild_member m;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
safestrncpy(tname, name, NAME_LENGTH);
if( strlen(trim(tname)) == 0 )
@@ -480,7 +480,7 @@ int guild_check_member(struct guild *g)
struct map_session_data *sd;
struct s_mapiterator* iter;
- nullpo_retr(0, g);
+ nullpo_ret(g);
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
@@ -526,7 +526,7 @@ int guild_recv_info(struct guild *sg)
struct map_session_data *sd;
bool guild_new = false;
- nullpo_retr(0, sg);
+ nullpo_ret(sg);
if((g = (struct guild*)idb_get(guild_db,sg->guild_id))==NULL)
{
@@ -616,7 +616,7 @@ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd)
struct guild *g;
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
g=guild_search(sd->status.guild_id);
@@ -666,7 +666,7 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
{
struct map_session_data* tsd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
// subsequent requests may override the value
if( sd->guild_invite != guild_id )
@@ -794,7 +794,7 @@ int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int c
{
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
g = guild_search(sd->status.guild_id);
@@ -817,7 +817,7 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i
struct guild *g;
int i,ps;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
g = guild_search(sd->status.guild_id);
@@ -892,7 +892,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
{ // cleaned up [LuzZza]
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->status.guild_id <= 0)
return 0;
@@ -986,7 +986,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
// ギルド会話送信
int guild_send_message(struct map_session_data *sd,const char *mes,int len)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->status.guild_id==0)
return 0;
@@ -1016,7 +1016,7 @@ int guild_change_memberposition(int guild_id,int account_id,int char_id,int idx)
// ギルドメンバの役職変更通知
int guild_memberposition_changed(struct guild *g,int idx,int pos)
{
- nullpo_retr(0, g);
+ nullpo_ret(g);
g->member[idx].position=pos;
clif_guild_memberpositionchanged(g,idx);
@@ -1059,7 +1059,7 @@ int guild_position_changed(int guild_id,int idx,struct guild_position *p)
// ギルド告知変更
int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(guild_id!=sd->status.guild_id)
return 0;
@@ -1087,7 +1087,7 @@ int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
{
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (battle_config.require_glory_guild &&
!((g = guild_search(sd->status.guild_id)) && guild_checkskill(g, GD_GLORYGUILD)>0)) {
@@ -1181,7 +1181,7 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
struct guild_expcache *c;
int per;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!exp) return 0;
@@ -1211,7 +1211,7 @@ int guild_getexp(struct map_session_data *sd,int exp)
{
struct guild *g;
struct guild_expcache *c;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL)
return 0;
@@ -1231,7 +1231,7 @@ int guild_skillup(TBL_PC* sd, int skill_num)
int idx = skill_num - GD_SKILLBASE;
int max = guild_skill_get_max(skill_num);
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( idx < 0 || idx >= MAX_GUILDSKILL || // not a guild skill
sd->status.guild_id == 0 || (g=guild_search(sd->status.guild_id)) == NULL || // no guild
@@ -1267,7 +1267,7 @@ int guild_get_alliance_count(struct guild *g,int flag)
{
int i,c;
- nullpo_retr(0, g);
+ nullpo_ret(g);
for(i=c=0;i<MAX_GUILDALLIANCE;i++){
if( g->alliance[i].guild_id>0 &&
@@ -1313,7 +1313,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
} // end addition [Valaris]
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(tsd==NULL || tsd->status.guild_id<=0)
return 0;
@@ -1361,7 +1361,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
{
struct map_session_data *tsd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
tsd= map_id2sd( account_id );
if (!tsd) { //Character left? Cancel alliance.
clif_guild_allianceack(sd,3);
@@ -1418,7 +1418,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
// ギルド関係解消
int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(agit_flag || agit2_flag) { // Disable alliance breaking during woe [Valaris]
clif_displaymessage(sd->fd,"Alliances cannot be broken during Guild Wars!");
@@ -1435,7 +1435,7 @@ int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
struct guild *g;
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
g=guild_search(sd->status.guild_id);
if(g==NULL || tsd==NULL)
@@ -1555,7 +1555,7 @@ int guild_broken_sub(DBKey key,void *data,va_list ap)
int i,j;
struct map_session_data *sd=NULL;
- nullpo_retr(0, g);
+ nullpo_ret(g);
for(i=0;i<MAX_GUILDALLIANCE;i++){ // 関係を破棄
if(g->alliance[i].guild_id==guild_id){
@@ -1575,7 +1575,7 @@ int castle_guild_broken_sub(DBKey key,void *data,va_list ap)
struct guild_castle *gc=(struct guild_castle *)data;
int guild_id=va_arg(ap,int);
- nullpo_retr(0, gc);
+ nullpo_ret(gc);
if (gc->guild_id == guild_id)
{ //Save the new 'owner', this should invoke guardian clean up and other such things.
@@ -1629,14 +1629,14 @@ int guild_broken(int guild_id,int flag)
int guild_gm_change(int guild_id, struct map_session_data *sd)
{
struct guild *g;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->status.guild_id != guild_id)
return 0;
g=guild_search(guild_id);
- nullpo_retr(0, g);
+ nullpo_ret(g);
if (strcmp(g->master, sd->status.name) == 0) //Nothing to change.
return 0;
@@ -1695,7 +1695,7 @@ int guild_break(struct map_session_data *sd,char *name)
struct guild *g;
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( (g=guild_search(sd->status.guild_id))==NULL )
return 0;
@@ -1856,7 +1856,7 @@ int guild_castlealldataload(int len,struct guild_castle *gc)
int n = (len-4) / sizeof(struct guild_castle);
int ev;
- nullpo_retr(0, gc);
+ nullpo_ret(gc);
//Last owned castle in the list invokes ::OnAgitinit
for( i = n-1; i >= 0 && !(gc[i].guild_id); --i );
@@ -1967,7 +1967,7 @@ bool guild_isallied(int guild_id, int guild_id2)
{
int i;
struct guild* g = guild_search(guild_id);
- nullpo_retr(0, g);
+ nullpo_ret(g);
ARR_FIND( 0, MAX_GUILDALLIANCE, i, g->alliance[i].guild_id == guild_id2 );
return( i < MAX_GUILDALLIANCE && g->alliance[i].opposition == 0 );
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index b74fe2a13..97a3274fb 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -87,7 +87,7 @@ int merc_hom_vaporize(struct map_session_data *sd, int flag)
{
struct homun_data *hd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
hd = sd->hd;
if (!hd || hd->homunculus.vaporize)
@@ -115,7 +115,7 @@ int merc_hom_vaporize(struct map_session_data *sd, int flag)
int merc_hom_delete(struct homun_data *hd, int emote)
{
struct map_session_data *sd;
- nullpo_retr(0, hd);
+ nullpo_ret(hd);
sd = hd->master;
if (!sd)
@@ -138,7 +138,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd)
int j,f=1;
int c=0;
- nullpo_retr(0, hd);
+ nullpo_ret(hd);
c = hd->homunculus.class_ - HM_CLASS_BASE;
for(i=0;i < MAX_SKILL_TREE && (id = hskill_tree[c][i].id) > 0;i++)
@@ -287,7 +287,7 @@ int merc_hom_evolution(struct homun_data *hd)
struct s_homunculus *hom;
struct h_stats *max, *min;
struct map_session_data *sd;
- nullpo_retr(0, hd);
+ nullpo_ret(hd);
if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class)
{
@@ -411,7 +411,7 @@ void merc_save(struct homun_data *hd)
int merc_menu(struct map_session_data *sd,int menunum)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->hd == NULL)
return 1;
@@ -522,7 +522,7 @@ static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr data)
int merc_hom_hungry_timer_delete(struct homun_data *hd)
{
- nullpo_retr(0, hd);
+ nullpo_ret(hd);
if(hd->hungry_timer != -1) {
delete_timer(hd->hungry_timer,merc_hom_hungry);
hd->hungry_timer = INVALID_TIMER;
@@ -762,7 +762,7 @@ int merc_create_homunculus_request(struct map_session_data *sd, int class_)
int merc_resurrect_homunculus(struct map_session_data* sd, unsigned char per, short x, short y)
{
struct homun_data* hd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!sd->status.hom_id)
return 0; // no homunculus
diff --git a/src/map/intif.c b/src/map/intif.c
index c0ac8f9d4..c8aad3807 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -195,7 +195,7 @@ int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fo
// The transmission of Wisp/Page to inter-server (player not found on this server)
int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (CheckForCharServer())
return 0;
@@ -317,7 +317,7 @@ int intif_saveregistry(struct map_session_data *sd, int type)
//Request the registries for this player.
int intif_request_registry(struct map_session_data *sd, int flag)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
sd->save_reg.account2_num = -1;
sd->save_reg.account_num = -1;
@@ -368,7 +368,7 @@ int intif_create_party(struct party_member *member,char *name,int item,int item2
{
if (CheckForCharServer())
return 0;
- nullpo_retr(0, member);
+ nullpo_ret(member);
WFIFOHEAD(inter_fd,64);
WFIFOW(inter_fd,0) = 0x3020;
@@ -506,7 +506,7 @@ int intif_guild_create(const char *name,const struct guild_member *master)
{
if (CheckForCharServer())
return 0;
- nullpo_retr(0, master);
+ nullpo_ret(master);
WFIFOHEAD(inter_fd,sizeof(struct guild_member)+(8+NAME_LENGTH));
WFIFOW(inter_fd,0)=0x3030;
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index a4d873cb0..fb7cbe86f 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -330,7 +330,7 @@ int itemdb_isequip(int nameid)
*------------------------------------------*/
int itemdb_isequip2(struct item_data *data)
{
- nullpo_retr(0, data);
+ nullpo_ret(data);
switch(data->type) {
case IT_WEAPON:
case IT_ARMOR:
@@ -363,7 +363,7 @@ int itemdb_isstackable(int nameid)
*------------------------------------------*/
int itemdb_isstackable2(struct item_data *data)
{
- nullpo_retr(0, data);
+ nullpo_ret(data);
switch(data->type) {
case IT_WEAPON:
case IT_ARMOR:
diff --git a/src/map/log.c b/src/map/log.c
index 5cafcf719..474a6bb96 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -63,7 +63,7 @@ int log_branch(struct map_session_data *sd)
if(!log_config.enable_logs)
return 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
if( log_config.sql_logs )
@@ -98,7 +98,7 @@ int log_branch(struct map_session_data *sd)
int log_pick_pc(struct map_session_data *sd, const char *type, int nameid, int amount, struct item *itm)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (!should_log_item(log_config.filter, nameid, amount))
return 0; //we skip logging this item set - it doesn't meet our logging conditions [Lupus]
@@ -148,7 +148,7 @@ int log_pick_mob(struct mob_data *md, const char *type, int nameid, int amount,
{
char* mapname;
- nullpo_retr(0, md);
+ nullpo_ret(md);
if (!should_log_item(log_config.filter, nameid, amount))
return 0; //we skip logging this item set - it doesn't meet our logging conditions [Lupus]
@@ -203,7 +203,7 @@ int log_zeny(struct map_session_data *sd, char *type, struct map_session_data *s
if(!log_config.enable_logs || (log_config.zeny != 1 && abs(amount) < log_config.zeny))
return 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
if( log_config.sql_logs )
@@ -235,7 +235,7 @@ int log_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp)
if(!log_config.enable_logs)
return 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
if( log_config.sql_logs )
@@ -268,7 +268,7 @@ int log_atcommand(struct map_session_data* sd, const char* message)
if(!log_config.enable_logs)
return 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
if( log_config.sql_logs )
@@ -307,7 +307,7 @@ int log_npc(struct map_session_data* sd, const char* message)
if(!log_config.enable_logs)
return 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#ifndef TXT_ONLY
if( log_config.sql_logs )
diff --git a/src/map/mail.c b/src/map/mail.c
index afef81fe6..c79381c66 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -29,7 +29,7 @@ void mail_clear(struct map_session_data *sd)
int mail_removeitem(struct map_session_data *sd, short flag)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
if( sd->mail.amount )
{
@@ -52,7 +52,7 @@ int mail_removeitem(struct map_session_data *sd, short flag)
int mail_removezeny(struct map_session_data *sd, short flag)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
if (flag && sd->mail.zeny > 0)
{ //Zeny send
@@ -160,7 +160,7 @@ void mail_getattachment(struct map_session_data* sd, int zeny, struct item* item
int mail_openmail(struct map_session_data *sd)
{
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
if( sd->state.storage_flag || sd->vender_id || sd->state.trading )
return 0;
diff --git a/src/map/map.c b/src/map/map.c
index a2ce3dcd5..f7f1f3a49 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -289,7 +289,7 @@ int map_addblock(struct block_list* bl)
{
int m, x, y, pos;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (bl->prev != NULL) {
ShowError("map_addblock: bl->prev != NULL\n");
@@ -337,7 +337,7 @@ int map_addblock(struct block_list* bl)
int map_delblock(struct block_list* bl)
{
int pos;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
// ?にblocklistから?けている
if (bl->prev == NULL) {
@@ -1373,7 +1373,7 @@ int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int fir
int r;
struct flooritem_data *fitem=NULL;
- nullpo_retr(0, item_data);
+ nullpo_ret(item_data);
if(!map_searchrandfreecell(m,&x,&y,flags&2?1:0))
return 0;
@@ -2072,7 +2072,7 @@ bool mapit_exists(struct s_mapiterator* mapit)
*------------------------------------------*/
bool map_addnpc(int m,struct npc_data *nd)
{
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
if( m < 0 || m >= map_num )
return false;
@@ -2131,7 +2131,7 @@ void map_spawnmobs(int m)
int map_removemobs_sub(struct block_list *bl, va_list ap)
{
struct mob_data *md = (struct mob_data *)bl;
- nullpo_retr(0, md);
+ nullpo_ret(md);
//When not to remove mob:
// doesn't respawn and is not a slave
@@ -2261,7 +2261,7 @@ uint8 map_calc_dir(struct block_list* src, int x, int y)
unsigned char dir = 0;
int dx, dy;
- nullpo_retr(0, src);
+ nullpo_ret(src);
dx = x-src->x;
dy = y-src->y;
@@ -3355,7 +3355,7 @@ int nick_db_final(DBKey key, void *data, va_list args)
int cleanup_sub(struct block_list *bl, va_list ap)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch(bl->type) {
case BL_PC:
diff --git a/src/map/mob.c b/src/map/mob.c
index 5db82f6c1..7452bbd81 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -527,7 +527,7 @@ static int mob_spawn_guardian_sub(int tid, unsigned int tick, int id, intptr dat
}
md = (struct mob_data*)bl;
- nullpo_retr(0, md->guardian_data);
+ nullpo_ret(md->guardian_data);
g = guild_search((int)data);
if (g == NULL)
@@ -721,8 +721,8 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state
{
int easy = 0;
- nullpo_retr(0, md);
- nullpo_retr(0, bl);
+ nullpo_ret(md);
+ nullpo_ret(bl);
switch (state) {
case MSS_RUSH:
case MSS_FOLLOW:
@@ -746,7 +746,7 @@ int mob_linksearch(struct block_list *bl,va_list ap)
struct block_list *target;
unsigned int tick;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
md=(struct mob_data *)bl;
class_ = va_arg(ap, int);
target = va_arg(ap, struct block_list *);
@@ -937,8 +937,8 @@ static int mob_can_changetarget(struct mob_data* md, struct block_list* target,
*------------------------------------------*/
int mob_target(struct mob_data *md,struct block_list *bl,int dist)
{
- nullpo_retr(0, md);
- nullpo_retr(0, bl);
+ nullpo_ret(md);
+ nullpo_ret(bl);
// Nothing will be carried out if there is no mind of changing TAGE by TAGE ending.
if(md->target_id && !mob_can_changetarget(md, bl, status_get_mode(&md->bl)))
@@ -966,7 +966,7 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
int mode;
int dist;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
mode= va_arg(ap,int);
@@ -1017,7 +1017,7 @@ static int mob_ai_sub_hard_changechase(struct block_list *bl,va_list ap)
struct mob_data *md;
struct block_list **target;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
@@ -1180,7 +1180,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
*------------------------------------------*/
int mob_unlocktarget(struct mob_data *md, unsigned int tick)
{
- nullpo_retr(0, md);
+ nullpo_ret(md);
switch (md->state.skillstate) {
case MSS_WALK:
@@ -1223,7 +1223,7 @@ int mob_randomwalk(struct mob_data *md,unsigned int tick)
int i,x,y,c,d;
int speed;
- nullpo_retr(0, md);
+ nullpo_ret(md);
if(DIFF_TICK(md->next_walktime,tick)>0 ||
!unit_can_move(&md->bl) ||
@@ -1574,7 +1574,7 @@ static int mob_ai_sub_lazy(struct mob_data *md, va_list args)
{
unsigned int tick;
- nullpo_retr(0, md);
+ nullpo_ret(md);
if(md->bl.prev == NULL)
return 0;
@@ -1774,8 +1774,8 @@ int mob_deleteslave_sub(struct block_list *bl,va_list ap)
struct mob_data *md;
int id;
- nullpo_retr(0, bl);
- nullpo_retr(0, md = (struct mob_data *)bl);
+ nullpo_ret(bl);
+ nullpo_ret(md = (struct mob_data *)bl);
id=va_arg(ap,int);
if(md->master_id > 0 && md->master_id == id )
@@ -1788,7 +1788,7 @@ int mob_deleteslave_sub(struct block_list *bl,va_list ap)
*------------------------------------------*/
int mob_deleteslave(struct mob_data *md)
{
- nullpo_retr(0, md);
+ nullpo_ret(md);
map_foreachinmap(mob_deleteslave_sub, md->bl.m, BL_MOB,md->bl.id);
return 0;
@@ -2472,8 +2472,8 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap)
struct mob_data *md;
struct guild* g;
- nullpo_retr(0, bl);
- nullpo_retr(0, md = (struct mob_data *)bl);
+ nullpo_ret(bl);
+ nullpo_ret(md = (struct mob_data *)bl);
if (!md->guardian_data)
return 0;
@@ -2522,7 +2522,7 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap)
*------------------------------------------*/
int mob_random_class (int *value, size_t count)
{
- nullpo_retr(0, value);
+ nullpo_ret(value);
// no count specified, look into the array manually, but take only max 5 elements
if (count < 1) {
@@ -2547,7 +2547,7 @@ int mob_class_change (struct mob_data *md, int class_)
unsigned int tick = gettick();
int i, c, hp_rate;
- nullpo_retr(0, md);
+ nullpo_ret(md);
if( md->bl.prev == NULL )
return 0;
@@ -2680,8 +2680,8 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
struct spawn_data data;
int count = 0,k=0,hp_rate=0;
- nullpo_retr(0, md2);
- nullpo_retr(0, value);
+ nullpo_ret(md2);
+ nullpo_ret(value);
memset(&data, 0, sizeof(struct spawn_data));
data.m = md2->bl.m;
@@ -2845,9 +2845,9 @@ int mob_getfriendstatus_sub(struct block_list *bl,va_list ap)
struct mob_data **fr, *md, *mmd;
int flag=0;
- nullpo_retr(0, bl);
- nullpo_retr(0, md=(struct mob_data *)bl);
- nullpo_retr(0, mmd=va_arg(ap,struct mob_data *));
+ nullpo_ret(bl);
+ nullpo_ret(md=(struct mob_data *)bl);
+ nullpo_ret(mmd=va_arg(ap,struct mob_data *));
if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) )
return 0;
@@ -2874,7 +2874,7 @@ int mob_getfriendstatus_sub(struct block_list *bl,va_list ap)
struct mob_data *mob_getfriendstatus(struct mob_data *md,int cond1,int cond2)
{
struct mob_data* fr = NULL;
- nullpo_retr(0, md);
+ nullpo_ret(md);
map_foreachinrange(mob_getfriendstatus_sub, &md->bl, 8,BL_MOB, md,cond1,cond2,&fr);
return fr;
@@ -2891,8 +2891,8 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
struct mob_data *fmd = NULL;
int i,j,n;
- nullpo_retr (0, md);
- nullpo_retr (0, ms = md->db->skill);
+ nullpo_ret(md);
+ nullpo_ret(ms = md->db->skill);
if (!battle_config.mob_skill_rate || md->ud.skilltimer != -1 || !md->db->maxskill)
return 0;
@@ -3155,7 +3155,7 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char
struct mob_db* db;
struct status_data *status;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( MOB_CLONE_START, MOB_CLONE_END, class_, mob_db_data[class_] == NULL );
if(class_ >= MOB_CLONE_END)
diff --git a/src/map/npc.c b/src/map/npc.c
index e33fab291..425967da7 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -138,8 +138,8 @@ int npc_enable_sub(struct block_list *bl, va_list ap)
struct map_session_data *sd;
struct npc_data *nd;
- nullpo_retr(0, bl);
- nullpo_retr(0, nd=va_arg(ap,struct npc_data *));
+ nullpo_ret(bl);
+ nullpo_ret(nd=va_arg(ap,struct npc_data *));
if(bl->type == BL_PC && (sd=(struct map_session_data *)bl))
{
TBL_PC *sd = (TBL_PC*)bl;
@@ -202,7 +202,7 @@ struct npc_data* npc_name2id(const char* name)
*------------------------------------------*/
int npc_event_dequeue(struct map_session_data* sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->npc_id)
{ //Current script is aborted.
@@ -276,9 +276,9 @@ int npc_event_doall_sub(DBKey key, void* data, va_list ap)
const char* name;
int rid;
- nullpo_retr(0, ev = (struct event_data *)data);
- nullpo_retr(0, c = va_arg(ap, int *));
- nullpo_retr(0, name = va_arg(ap, const char *));
+ nullpo_ret(ev = (struct event_data *)data);
+ nullpo_ret(c = va_arg(ap, int *));
+ nullpo_ret(name = va_arg(ap, const char *));
rid = va_arg(ap, int);
p = strchr(p, ':'); // match only the event name
@@ -301,9 +301,9 @@ static int npc_event_do_sub(DBKey key, void* data, va_list ap)
int* c;
const char* name;
- nullpo_retr(0, ev = (struct event_data *)data);
- nullpo_retr(0, c = va_arg(ap, int *));
- nullpo_retr(0, name = va_arg(ap, const char *));
+ nullpo_ret(ev = (struct event_data *)data);
+ nullpo_ret(c = va_arg(ap, int *));
+ nullpo_ret(name = va_arg(ap, const char *));
if( p && strcmpi(name, p) == 0 )
{
@@ -525,7 +525,7 @@ int npc_timerevent_start(struct npc_data* nd, int rid)
struct map_session_data *sd = NULL; //Player to whom script is attached.
struct timer_event_data *ted;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
// No need to start because of no events
if( nd->u.scr.timeramount == 0 )
@@ -579,7 +579,7 @@ int npc_timerevent_stop(struct npc_data* nd)
const struct TimerData *td = NULL;
int *tid;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
if( nd->u.scr.rid && !(sd = map_id2sd(nd->u.scr.rid)) )
{
@@ -676,7 +676,7 @@ void npc_timerevent_quit(struct map_session_data* sd)
int npc_gettimerevent_tick(struct npc_data* nd)
{
int tick;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
// TODO: Get player attached timer's tick. Now we can just get it by using 'getnpctimer' inside OnTimer event.
@@ -696,7 +696,7 @@ int npc_settimerevent_tick(struct npc_data* nd, int newtimer)
int old_rid;
//struct map_session_data *sd = NULL;
- nullpo_retr(0, nd);
+ nullpo_ret(nd);
// TODO: Set player attached timer's tick.
@@ -748,7 +748,7 @@ int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
struct event_data* ev = (struct event_data*)strdb_get(ev_db, eventname);
struct npc_data *nd;
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
if( ev == NULL || (nd = ev->nd) == NULL )
{
@@ -777,8 +777,8 @@ int npc_touch_areanpc_sub(struct block_list *bl, va_list ap)
int pc_id,npc_id;
char *name;
- nullpo_retr(0,bl);
- nullpo_retr(0,(sd = map_id2sd(bl->id)));
+ nullpo_ret(bl);
+ nullpo_ret((sd = map_id2sd(bl->id)));
pc_id = va_arg(ap,int);
npc_id = va_arg(ap,int);
@@ -1937,9 +1937,9 @@ int npc_convertlabel_db(DBKey key, void* data, va_list ap)
const char *p;
int len;
- nullpo_retr(0, label_list = va_arg(ap,struct npc_label_list**));
- nullpo_retr(0, label_list_num = va_arg(ap,int*));
- nullpo_retr(0, filepath = va_arg(ap,const char*));
+ nullpo_ret(label_list = va_arg(ap,struct npc_label_list**));
+ nullpo_ret(label_list_num = va_arg(ap,int*));
+ nullpo_ret(filepath = va_arg(ap,const char*));
if( *label_list == NULL )
{
diff --git a/src/map/party.c b/src/map/party.c
index 33c079fdf..e6a7ffd8b 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -185,7 +185,7 @@ int party_check_member(struct party *p)
struct map_session_data *sd;
struct s_mapiterator* iter;
- nullpo_retr(0, p);
+ nullpo_ret(p);
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
@@ -262,7 +262,7 @@ int party_recv_info(struct party *sp)
int i;
bool party_new = false;
- nullpo_retr(0, sp);
+ nullpo_ret(sp);
p = (struct party_data*)idb_ensure(party_db, sp->party_id, create_party);
if (!p->party.party_id) //party just received.
@@ -300,7 +300,7 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
struct party_data *p=party_search(sd->status.party_id);
int i,flag=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( p == NULL )
return 0;
if( tsd == NULL) { //TODO: Find the correct reply packet.
@@ -587,7 +587,7 @@ int party_broken(int party_id)
int party_changeoption(struct map_session_data *sd,int exp,int item)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->status.party_id==0)
return 0;
@@ -874,7 +874,7 @@ int party_send_xy_clear(struct party_data *p)
{
int i;
- nullpo_retr(0, p);
+ nullpo_ret(p);
for(i=0;i<MAX_PARTY;i++){
if(!p->data[i].sd) continue;
@@ -891,7 +891,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
struct map_session_data* sd[MAX_PARTY];
unsigned int i, c;
- nullpo_retr(0, p);
+ nullpo_ret(p);
// count the number of players eligible for exp sharing
for (i = c = 0; i < MAX_PARTY; i++) {
@@ -1028,7 +1028,7 @@ int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_sess
int blockcount=0;
int total = 0; //Return value.
- nullpo_retr(0,sd);
+ nullpo_ret(sd);
if((p=party_search(sd->status.party_id))==NULL)
return 0;
diff --git a/src/map/pc.c b/src/map/pc.c
index f31442d28..808d47792 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -162,7 +162,7 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max)
{
int tid, i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(max > MAX_SKILL_LEVEL)
max = MAX_SKILL_LEVEL;
@@ -194,7 +194,7 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->spiritball <= 0) {
sd->spiritball = 0;
@@ -279,7 +279,7 @@ unsigned char pc_famerank(int char_id, int job)
int pc_setrestartvalue(struct map_session_data *sd,int type)
{
struct status_data *status, *b_status;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
b_status = &sd->base_status;
status = &sd->battle_status;
@@ -433,7 +433,7 @@ bool pc_can_give_items(int level)
*------------------------------------------*/
int pc_makesavestatus(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!battle_config.save_clothcolor)
sd->status.clothes_color=0;
@@ -483,7 +483,7 @@ int pc_makesavestatus(struct map_session_data *sd)
*------------------------------------------*/
int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
sd->bl.id = account_id;
sd->status.account_id = account_id;
@@ -504,7 +504,7 @@ int pc_equippoint(struct map_session_data *sd,int n)
{
int ep = 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!sd->inventory_data[n])
return 0;
@@ -526,7 +526,7 @@ int pc_setinventorydata(struct map_session_data *sd)
{
int i,id;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=0;i<MAX_INVENTORY;i++) {
id = sd->status.inventory[i].nameid;
@@ -537,7 +537,7 @@ int pc_setinventorydata(struct map_session_data *sd)
int pc_calcweapontype(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
// single-hand
if(sd->weapontype2 == W_FIST) {
@@ -583,7 +583,7 @@ int pc_setequipindex(struct map_session_data *sd)
{
int i,j;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=0;i<EQI_MAX;i++)
sd->equip_index[i] = -1;
@@ -752,7 +752,7 @@ int pc_isequip(struct map_session_data *sd,int n)
struct item_data *item;
//?生や養子の場合の元の職業を算出する
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
item = sd->inventory_data[n];
@@ -1102,7 +1102,7 @@ static int pc_calc_skillpoint(struct map_session_data* sd)
{
int i,skill,inf2,skill_point=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=1;i<MAX_SKILL;i++){
if( (skill = pc_checkskill(sd,i)) > 0) {
@@ -1131,7 +1131,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
int i,id=0,flag;
int c=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
i = pc_calc_skilltree_normalize_job(sd);
c = pc_mapid2jobid(i, sd->status.sex);
if( c == -1 )
@@ -1661,7 +1661,7 @@ int pc_addautobonus(struct s_autobonus *bonus,char max,const char *script,short
int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,char max,bool restore)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for( i = 0; i < max; i++ )
{
@@ -1697,8 +1697,8 @@ int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,c
int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus)
{
- nullpo_retr(0, sd);
- nullpo_retr(0, autobonus);
+ nullpo_ret(sd);
+ nullpo_ret(autobonus);
if( autobonus->other_script )
{
@@ -1720,8 +1720,8 @@ int pc_endautobonus(int tid, unsigned int tick, int id, intptr data)
struct map_session_data *sd = map_id2sd(id);
struct s_autobonus *autobonus = (struct s_autobonus *)data;
- nullpo_retr(0, sd);
- nullpo_retr(0, autobonus);
+ nullpo_ret(sd);
+ nullpo_ret(autobonus);
autobonus->active = INVALID_TIMER;
sd->state.autobonus &= ~autobonus->pos;
@@ -1801,7 +1801,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
{
struct status_data *status;
int bonus;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
status = &sd->base_status;
@@ -2365,7 +2365,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case SP_ADDELE:
@@ -2826,7 +2826,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case SP_ADD_MONSTER_DROP_ITEM:
@@ -2950,7 +2950,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4,int val)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case SP_AUTOSPELL:
@@ -2992,7 +2992,7 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4
int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4,int type5,int val)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case SP_AUTOSPELL:
@@ -3027,7 +3027,7 @@ int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4
*------------------------------------------*/
int pc_skill(TBL_PC* sd, int id, int level, int flag)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( id <= 0 || id >= MAX_SKILL || skill_db[id].name == NULL) {
ShowError("pc_skill: Skill with id %d does not exist in the skill database\n", id);
@@ -3092,7 +3092,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
int i;
int nameid;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( idx_equip < 0 || idx_equip >= MAX_INVENTORY || sd->inventory_data[idx_equip] == NULL )
return 0; //Invalid item index.
@@ -3184,7 +3184,7 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!itemdb_isstackable(nameid))
return ADDITEM_NEW;
@@ -3209,7 +3209,7 @@ int pc_inventoryblank(struct map_session_data *sd)
{
int i,b;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=0,b=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid==0)
@@ -3224,7 +3224,7 @@ int pc_inventoryblank(struct map_session_data *sd)
*------------------------------------------*/
int pc_payzeny(struct map_session_data *sd,int zeny)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( zeny < 0 )
return pc_getzeny(sd, -zeny);
@@ -3280,7 +3280,7 @@ void pc_getcash(struct map_session_data *sd, int cash, int points)
*------------------------------------------*/
int pc_getzeny(struct map_session_data *sd,int zeny)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( zeny < 0 )
return pc_payzeny(sd, -zeny);
@@ -3456,8 +3456,8 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
struct map_session_data *first_sd = NULL,*second_sd = NULL,*third_sd = NULL;
struct party_data *p=NULL;
- nullpo_retr(0, sd);
- nullpo_retr(0, fitem);
+ nullpo_ret(sd);
+ nullpo_ret(fitem);
if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED)
return 0; // 距離が遠い
@@ -3519,7 +3519,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
struct item_data *item;
int nameid;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
item = sd->inventory_data[n];
nameid = sd->status.inventory[n].nameid;
@@ -3657,7 +3657,7 @@ int pc_useitem(struct map_session_data *sd,int n)
int amount;
struct script_code *script;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
return 0;
@@ -3815,7 +3815,7 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
{
struct item *item_data;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (idx < 0 || idx >= MAX_INVENTORY) //Invalid index check [Skotlex]
return 1;
@@ -3855,7 +3855,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
struct item *item_data;
int flag;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (idx < 0 || idx >= MAX_CART) //Invalid index check [Skotlex]
return 1;
@@ -4016,7 +4016,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
struct party_data *p;
int m;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( !mapindex || !mapindex_id2name(mapindex) )
{
@@ -4174,7 +4174,7 @@ int pc_randomwarp(struct map_session_data *sd, int type)
int x,y,i=0;
int m;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
m=sd->bl.m;
@@ -4200,7 +4200,7 @@ int pc_memo(struct map_session_data* sd, int pos)
{
int skill;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
// check mapflags
if( sd->bl.m >= 0 && (map[sd->bl.m].flag.nomemo || map[sd->bl.m].flag.nowarpto) && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
@@ -4290,7 +4290,7 @@ int pc_checkallowskill(struct map_session_data *sd)
SC_REFLECTSHIELD
};
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!sd->sc.count)
return 0;
@@ -4650,7 +4650,7 @@ int pc_follow_timer(int tid, unsigned int tick, int id, intptr data)
struct block_list *tbl;
sd = map_id2sd(id);
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->followtimer != tid){
ShowError("pc_follow_timer %d != %d\n",sd->followtimer,tid);
@@ -4687,7 +4687,7 @@ int pc_follow_timer(int tid, unsigned int tick, int id, intptr data)
int pc_stop_following (struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->followtimer != INVALID_TIMER) {
delete_timer(sd->followtimer,pc_follow_timer);
@@ -4771,7 +4771,7 @@ int pc_checkjoblevelup(struct map_session_data *sd)
{
unsigned int next = pc_nextjobexp(sd);
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(!next || sd->status.job_exp < next)
return 0;
@@ -4833,7 +4833,7 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
{
float nextbp=0, nextjp=0;
unsigned int nextb=0, nextj=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->bl.prev == NULL || pc_isdead(sd))
return 0;
@@ -4927,7 +4927,7 @@ unsigned int pc_maxjoblv(struct map_session_data *sd)
*------------------------------------------*/
unsigned int pc_nextbaseexp(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->status.base_level>=pc_maxbaselv(sd) || sd->status.base_level<=0)
return 0;
@@ -4949,7 +4949,7 @@ unsigned int pc_thisbaseexp(struct map_session_data *sd)
*------------------------------------------*/
unsigned int pc_nextjobexp(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->status.job_level>=pc_maxjoblv(sd) || sd->status.job_level<=0)
return 0;
@@ -5015,7 +5015,7 @@ int pc_statusup(struct map_session_data* sd, int type)
{
int max, need, val;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
// check conditions
need = pc_need_status_point(sd,type);
@@ -5063,7 +5063,7 @@ int pc_statusup(struct map_session_data* sd, int type)
int pc_statusup2(struct map_session_data* sd, int type, int val)
{
int max, need;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( type < SP_STR || type > SP_LUK )
{
@@ -5096,7 +5096,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
*------------------------------------------*/
int pc_skillup(struct map_session_data *sd,int skill_num)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( skill_num >= GD_SKILLBASE && skill_num < GD_SKILLBASE+MAX_GUILDSKILL )
{
@@ -5142,7 +5142,7 @@ int pc_allskillup(struct map_session_data *sd)
{
int i,id;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=0;i<MAX_SKILL;i++){
if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){
@@ -5190,7 +5190,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (type != 3) //Also reset skills
pc_resetskill(sd, 0);
@@ -5274,7 +5274,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
*------------------------------------------*/
int pc_resetstate(struct map_session_data* sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (battle_config.use_statpoint_table)
{ // New statpoint table used here - Dexity
@@ -5336,7 +5336,7 @@ int pc_resetstate(struct map_session_data* sd)
int pc_resetskill(struct map_session_data* sd, int flag)
{
int i, lv, inf2, skill_point=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( !(flag&2) )
{ //Remove stuff lost when resetting skills.
@@ -5423,7 +5423,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
int pc_resetfeel(struct map_session_data* sd)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for (i=0; i<3; i++)
{
@@ -5438,7 +5438,7 @@ int pc_resetfeel(struct map_session_data* sd)
int pc_resethate(struct map_session_data* sd)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for (i=0; i<3; i++)
{
@@ -5861,7 +5861,7 @@ int pc_readparam(struct map_session_data* sd,int type)
{
int val = 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type) {
case SP_SKILLPOINT: val = sd->status.skill_point; break;
@@ -5905,7 +5905,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
{
int i = 0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case SP_BASELEVEL:
@@ -6090,7 +6090,7 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
*------------------------------------------*/
int pc_percentheal(struct map_session_data *sd,int hp,int sp)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(hp > 100) hp = 100;
else
@@ -6134,7 +6134,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
int i, fame_flag=0;
int b_class;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (job < 0)
return 1;
@@ -6260,7 +6260,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
*------------------------------------------*/
int pc_equiplookall(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
#if PACKETVER < 4
clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
@@ -6281,7 +6281,7 @@ int pc_equiplookall(struct map_session_data *sd)
*------------------------------------------*/
int pc_changelook(struct map_session_data *sd,int type,int val)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch(type){
case LOOK_HAIR: //Use the battle_config limits! [Skotlex]
@@ -6345,7 +6345,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
int pc_setoption(struct map_session_data *sd,int type)
{
int p_type, new_look=0;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
p_type = sd->sc.option;
//Option has to be changed client-side before the class sprite or it won't always work (eg: Wedding sprite) [Skotlex]
@@ -6427,7 +6427,7 @@ int pc_setcart(struct map_session_data *sd,int type)
int cart[6] = {0x0000,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5};
int option;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( type < 0 || type > 5 )
return 1;// Never trust the values sent by the client! [Skotlex]
@@ -6494,7 +6494,7 @@ int pc_readreg(struct map_session_data* sd, int reg)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( 0, sd->reg_num, i, sd->reg[i].index == reg );
return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
@@ -6506,7 +6506,7 @@ int pc_setreg(struct map_session_data* sd, int reg, int val)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( 0, sd->reg_num, i, sd->reg[i].index == reg );
if( i < sd->reg_num )
@@ -6534,7 +6534,7 @@ char* pc_readregstr(struct map_session_data* sd, int reg)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( 0, sd->regstr_num, i, sd->regstr[i].index == reg );
return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
@@ -6546,7 +6546,7 @@ int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( 0, sd->regstr_num, i, sd->regstr[i].index == reg );
if( i < sd->regstr_num )
@@ -6590,7 +6590,7 @@ int pc_readregistry(struct map_session_data *sd,const char *reg,int type)
struct global_reg *sd_reg;
int i,max;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch (type) {
case 3: //Char reg
sd_reg = sd->save_reg.global;
@@ -6623,7 +6623,7 @@ char* pc_readregistry_str(struct map_session_data *sd,const char *reg,int type)
struct global_reg *sd_reg;
int i,max;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch (type) {
case 3: //Char reg
sd_reg = sd->save_reg.global;
@@ -6656,7 +6656,7 @@ int pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type)
struct global_reg *sd_reg;
int i,*max, regmax;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
switch( type )
{
@@ -6747,7 +6747,7 @@ int pc_setregistry_str(struct map_session_data *sd,const char *reg,const char *v
struct global_reg *sd_reg;
int i,*max, regmax;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (reg[strlen(reg)-1] != '$') {
ShowError("pc_setregistry_str : reg %s must be string (end in '$') to use this!\n", reg);
return 0;
@@ -6850,7 +6850,7 @@ static int pc_eventtimer(int tid, unsigned int tick, int id, intptr data)
int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
ARR_FIND( 0, MAX_EVENTTIMER, i, sd->eventtimer[i] == -1 );
if( i == MAX_EVENTTIMER )
@@ -6870,7 +6870,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name)
char* p = NULL;
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->eventcount <= 0)
return 0;
@@ -6899,7 +6899,7 @@ int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
for(i=0;i<MAX_EVENTTIMER;i++)
if( sd->eventtimer[i]!=-1 && strcmp(
@@ -6918,7 +6918,7 @@ int pc_cleareventtimer(struct map_session_data *sd)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->eventcount <= 0)
return 0;
@@ -6945,7 +6945,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
int i,pos,flag=0;
struct item_data *id;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( n < 0 || n >= MAX_INVENTORY ) {
clif_equipitemack(sd,0,0,0);
@@ -7106,7 +7106,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
int pc_unequipitem(struct map_session_data *sd,int n,int flag)
{
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( n < 0 || n >= MAX_INVENTORY ) {
clif_unequipitemack(sd,0,0,0);
@@ -7217,7 +7217,7 @@ int pc_checkitem(struct map_session_data *sd)
int i,j,k,id,calc_flag = 0;
struct item_data *it=NULL;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->vender_id ) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam)
return 0;
@@ -7524,7 +7524,7 @@ void pc_regen (struct map_session_data *sd, unsigned int diff_tick)
*------------------------------------------*/
int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
sd->status.save_point.map = mapindex;
sd->status.save_point.x = x;
diff --git a/src/map/pet.c b/src/map/pet.c
index 76f990455..d02f93446 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -42,7 +42,7 @@ static struct eri *item_drop_list_ers;
int pet_hungry_val(struct pet_data *pd)
{
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
if(pd->pet.hungry > 90)
return 4;
@@ -86,7 +86,7 @@ int pet_create_egg(struct map_session_data *sd, int item_id)
int pet_unlocktarget(struct pet_data *pd)
{
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
pd->target_id=0;
pet_stop_attack(pd);
@@ -174,7 +174,7 @@ int pet_sc_check(struct map_session_data *sd, int type)
{
struct pet_data *pd;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
pd = sd->pd;
if( pd == NULL
@@ -262,7 +262,7 @@ int search_petDB_index(int key,int type)
int pet_hungry_timer_delete(struct pet_data *pd)
{
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
if(pd->pet_hungry_timer != -1) {
delete_timer(pd->pet_hungry_timer,pet_hungry);
pd->pet_hungry_timer = INVALID_TIMER;
@@ -463,7 +463,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
int pet_select_egg(struct map_session_data *sd,short egg_index)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(egg_index < 0 || egg_index >= MAX_INVENTORY)
return 0; //Forged packet!
@@ -478,7 +478,7 @@ int pet_select_egg(struct map_session_data *sd,short egg_index)
int pet_catch_process1(struct map_session_data *sd,int target_class)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
sd->catch_target_class = target_class;
clif_catch_process(sd);
@@ -580,7 +580,7 @@ static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap);
int pet_menu(struct map_session_data *sd,int menunum)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (sd->pd == NULL)
return 1;
@@ -776,7 +776,7 @@ static int pet_randomwalk(struct pet_data *pd,unsigned int tick)
{
const int retrycount=20;
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
Assert((pd->msd == 0) || (pd->msd->pd == pd));
diff --git a/src/map/quest.c b/src/map/quest.c
index 13b8872eb..d751b27ff 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -190,8 +190,8 @@ int quest_update_objective_sub(struct block_list *bl, va_list ap)
struct map_session_data * sd;
int mob, party;
- nullpo_retr(0, bl);
- nullpo_retr(0, sd = (struct map_session_data *)bl);
+ nullpo_ret(bl);
+ nullpo_ret(sd = (struct map_session_data *)bl);
party = va_arg(ap,int);
mob = va_arg(ap,int);
diff --git a/src/map/skill.c b/src/map/skill.c
index baf30af35..6a7f94e1e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -491,8 +491,8 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
int skill;
int rate;
- nullpo_retr(0, src);
- nullpo_retr(0, bl);
+ nullpo_ret(src);
+ nullpo_ret(bl);
if(skillid < 0) return 0;
if(skillid > 0 && skilllv <= 0) return 0; // don't forget auto attacks! - celest
@@ -1161,8 +1161,8 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
struct map_session_data *dstsd=NULL;
struct status_change *tsc;
- nullpo_retr(0, src);
- nullpo_retr(0, bl);
+ nullpo_ret(src);
+ nullpo_ret(bl);
if(skillid < 0) return 0;
if(skillid > 0 && skilllv <= 0) return 0; // don't forget auto attacks! - celest
@@ -1474,7 +1474,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
int ret;
struct skill_unit* su = NULL;
- nullpo_retr(0, src);
+ nullpo_ret(src);
if (src != target && (map_flag_gvg(target->m) || map[target->m].flag.battleground))
return 0; //No knocking back in WoE
@@ -1613,9 +1613,9 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if(skillid > 0 && skilllv <= 0) return 0;
- nullpo_retr(0, src); //Source is the master behind the attack (player/mob/pet)
- nullpo_retr(0, dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src.
- nullpo_retr(0, bl); //Target to be attacked.
+ nullpo_ret(src); //Source is the master behind the attack (player/mob/pet)
+ nullpo_ret(dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src.
+ nullpo_ret(bl); //Target to be attacked.
if (src != dsrc) {
//When caster is not the src of attack, this is a ground skill, and as such, do the relevant target checking. [Skotlex]
@@ -2010,7 +2010,7 @@ int skill_area_sub (struct block_list *bl, va_list ap)
unsigned int tick;
SkillFunc func;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
src=va_arg(ap,struct block_list *);
skill_id=va_arg(ap,int);
@@ -2197,7 +2197,7 @@ static int skill_check_condition_mercenary(struct block_list *bl, int skill, int
if( lv < 1 || lv > MAX_SKILL_LEVEL )
return 0;
- nullpo_retr(0,bl);
+ nullpo_ret(bl);
switch( bl->type )
{
@@ -2321,10 +2321,10 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr data)
struct skill_timerskill *skl = NULL;
int range;
- nullpo_retr(0, src);
- nullpo_retr(0, ud);
+ nullpo_ret(src);
+ nullpo_ret(ud);
skl = ud->skilltimerskill[data];
- nullpo_retr(0, skl);
+ nullpo_ret(skl);
ud->skilltimerskill[data] = NULL;
do {
@@ -2450,9 +2450,9 @@ int skill_cleartimerskill (struct block_list *src)
{
int i;
struct unit_data *ud;
- nullpo_retr(0, src);
+ nullpo_ret(src);
ud = unit_bl2ud(src);
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
for(i=0;i<MAX_SKILLTIMERSKILL;i++) {
if(ud->skilltimerskill[i]) {
@@ -6071,7 +6071,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr data)
struct unit_data *ud = unit_bl2ud(src);
struct mob_data *md;
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
sd = BL_CAST(BL_PC , src);
md = BL_CAST(BL_MOB, src);
@@ -6223,7 +6223,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
//if(skilllv <= 0) return 0;
if(skillid > 0 && skilllv <= 0) return 0; // celest
- nullpo_retr(0, src);
+ nullpo_ret(src);
if(status_isdead(src))
return 0;
@@ -6637,7 +6637,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
*------------------------------------------*/
int skill_castend_map (struct map_session_data *sd, short skill_num, const char *map)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
//Simplify skill_failed code.
#define skill_failed(sd) { sd->menuskill_id = sd->menuskill_val = 0; }
@@ -7230,14 +7230,14 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
enum sc_type type;
int skillid;
- nullpo_retr(0, src);
- nullpo_retr(0, bl);
+ nullpo_ret(src);
+ nullpo_ret(bl);
if(bl->prev==NULL || !src->alive || status_isdead(bl))
return 0;
- nullpo_retr(0, sg=src->group);
- nullpo_retr(0, ss=map_id2bl(sg->src_id));
+ nullpo_ret(sg=src->group);
+ nullpo_ret(ss=map_id2bl(sg->src_id));
if( skill_get_type(sg->skill_id) == BF_MAGIC && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) && sg->skill_id != SA_LANDPROTECTOR )
return 0; //AoE skills are ineffective. [Skotlex]
@@ -7415,14 +7415,14 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
int skillid;
int diff=0;
- nullpo_retr(0, src);
- nullpo_retr(0, bl);
+ nullpo_ret(src);
+ nullpo_ret(bl);
if (bl->prev==NULL || !src->alive || status_isdead(bl))
return 0;
- nullpo_retr(0, sg=src->group);
- nullpo_retr(0, ss=map_id2bl(sg->src_id));
+ nullpo_ret(sg=src->group);
+ nullpo_ret(ss=map_id2bl(sg->src_id));
sd = BL_CAST(BL_PC, ss);
tsd = BL_CAST(BL_PC, bl);
tsc = status_get_sc(bl);
@@ -7834,9 +7834,9 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
struct status_change_entry *sce;
enum sc_type type;
- nullpo_retr(0, src);
- nullpo_retr(0, bl);
- nullpo_retr(0, sg=src->group);
+ nullpo_ret(src);
+ nullpo_ret(bl);
+ nullpo_ret(sg=src->group);
sc = status_get_sc(bl);
type = status_skill2sc(sg->skill_id);
sce = (sc && type != -1)?sc->data[type]:NULL;
@@ -7986,7 +7986,7 @@ static int skill_unit_effect (struct block_list* bl, va_list ap)
if( (!unit->alive && !(flag&4)) || bl->prev == NULL )
return 0;
- nullpo_retr(0, group);
+ nullpo_ret(group);
dissonance = skill_dance_switch(unit, 0);
@@ -8022,8 +8022,8 @@ int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int dam
{
struct skill_unit_group *sg;
- nullpo_retr(0, src);
- nullpo_retr(0, sg=src->group);
+ nullpo_ret(src);
+ nullpo_ret(sg=src->group);
switch( sg->unit_id )
{
@@ -8060,10 +8060,10 @@ static int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
struct map_session_data *tsd;
int *p_sd; //Contains the list of characters found.
- nullpo_retr(0, bl);
- nullpo_retr(0, tsd=(struct map_session_data*)bl);
- nullpo_retr(0, src=va_arg(ap,struct block_list *));
- nullpo_retr(0, sd=(struct map_session_data*)src);
+ nullpo_ret(bl);
+ nullpo_ret(tsd=(struct map_session_data*)bl);
+ nullpo_ret(src=va_arg(ap,struct block_list *));
+ nullpo_ret(sd=(struct map_session_data*)src);
c=va_arg(ap,int *);
p_sd = va_arg(ap, int *);
@@ -8210,7 +8210,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
struct skill_condition require;
int i;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if (lv <= 0 || sd->chatID) return 0;
@@ -8696,7 +8696,7 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor
int i;
int index[MAX_SKILL_ITEM_REQUIRE];
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( lv <= 0 || sd->chatID )
return 0;
@@ -8810,7 +8810,7 @@ int skill_consume_requirement( struct map_session_data *sd, short skill, short l
int n,i;
struct skill_condition req;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
req = skill_get_requirement(sd,skill,lv);
@@ -9041,7 +9041,7 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
struct map_session_data *sd;
struct status_change *sc;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sd = BL_CAST(BL_PC, bl);
sc = status_get_sc(bl);
@@ -9113,7 +9113,7 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
struct map_session_data *sd;
struct status_change *sc = status_get_sc(bl);
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sd = BL_CAST(BL_PC, bl);
if (skill_id == SA_ABRACADABRA)
@@ -9465,7 +9465,7 @@ int skill_autospell (struct map_session_data *sd, int skillid)
int skilllv;
int maxlv=1,lv;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
skilllv = sd->menuskill_val;
lv=pc_checkskill(sd,skillid);
@@ -9563,7 +9563,7 @@ int skill_sit (struct map_session_data *sd, int type)
{
int flag = 0;
int range = 0, lv;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if((lv = pc_checkskill(sd,RG_GANGSTER)) > 0) {
@@ -9600,8 +9600,8 @@ int skill_frostjoke_scream (struct block_list *bl, va_list ap)
int skillnum,skilllv;
unsigned int tick;
- nullpo_retr(0, bl);
- nullpo_retr(0, src=va_arg(ap,struct block_list*));
+ nullpo_ret(bl);
+ nullpo_ret(src=va_arg(ap,struct block_list*));
skillnum=va_arg(ap,int);
skilllv=va_arg(ap,int);
@@ -9689,7 +9689,7 @@ int skill_clear_group (struct block_list *bl, int flag)
struct skill_unit_group *group[MAX_SKILLUNITGROUP];
int i, count=0;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (!ud) return 0;
//All groups to be deleted are first stored on an array since the array elements shift around when you delete them. [Skotlex]
@@ -9724,7 +9724,7 @@ struct skill_unit_group *skill_locate_element_field(struct block_list *bl)
{
struct unit_data *ud = unit_bl2ud(bl);
int i;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (!ud) return NULL;
for (i=0;i<MAX_SKILLUNITGROUP && ud->skillunit[i];i++) {
@@ -9745,8 +9745,8 @@ int skill_graffitiremover (struct block_list *bl, va_list ap)
{
struct skill_unit *unit=NULL;
- nullpo_retr(0, bl);
- nullpo_retr(0, ap);
+ nullpo_ret(bl);
+ nullpo_ret(ap);
if(bl->type!=BL_SKILL || (unit=(struct skill_unit *)bl) == NULL)
return 0;
@@ -9763,8 +9763,8 @@ int skill_greed (struct block_list *bl, va_list ap)
struct map_session_data *sd=NULL;
struct flooritem_data *fitem=NULL;
- nullpo_retr(0, bl);
- nullpo_retr(0, src = va_arg(ap, struct block_list *));
+ nullpo_ret(bl);
+ nullpo_ret(src = va_arg(ap, struct block_list *));
if(src->type == BL_PC && (sd=(struct map_session_data *)src) && bl->type==BL_ITEM && (fitem=(struct flooritem_data *)bl))
pc_takeitem(sd, fitem);
@@ -9902,8 +9902,8 @@ static int skill_trap_splash (struct block_list *bl, va_list ap)
unit = (struct skill_unit *)src;
tick = va_arg(ap,int);
- nullpo_retr(0, sg = unit->group);
- nullpo_retr(0, ss = map_id2bl(sg->src_id));
+ nullpo_ret(sg = unit->group);
+ nullpo_ret(ss = map_id2bl(sg->src_id));
if(battle_check_target(src,bl,BCT_ENEMY) <= 0)
return 0;
@@ -9949,8 +9949,8 @@ int skill_enchant_elemental_end (struct block_list *bl, int type)
struct status_change *sc;
const enum sc_type scs[] = { SC_ENCPOISON, SC_ASPERSIO, SC_FIREWEAPON, SC_WATERWEAPON, SC_WINDWEAPON, SC_EARTHWEAPON, SC_SHADOWWEAPON, SC_GHOSTWEAPON, SC_ENCHANTARMS };
int i;
- nullpo_retr(0, bl);
- nullpo_retr(0, sc= status_get_sc(bl));
+ nullpo_ret(bl);
+ nullpo_ret(sc= status_get_sc(bl));
if (!sc->count) return 0;
@@ -10060,12 +10060,12 @@ int skill_delunit (struct skill_unit* unit)
{
struct skill_unit_group *group;
- nullpo_retr(0, unit);
+ nullpo_ret(unit);
if( !unit->alive )
return 0;
unit->alive=0;
- nullpo_retr(0, group=unit->group);
+ nullpo_ret(group=unit->group);
if( group->state.song_dance&0x1 ) //Cancel dissonance effect.
skill_dance_overlap(unit, 0);
@@ -10208,7 +10208,7 @@ int skill_delunitgroup (struct skill_unit_group *group)
struct unit_data *ud;
int i,j;
- nullpo_retr(0, group);
+ nullpo_ret(group);
src=map_id2bl(group->src_id);
ud = unit_bl2ud(src);
@@ -10291,7 +10291,7 @@ int skill_clear_unitgroup (struct block_list *src)
{
struct unit_data *ud = unit_bl2ud(src);
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
while (ud->skillunit[0])
skill_delunitgroup(ud->skillunit[0]);
@@ -10308,7 +10308,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_lis
struct unit_data *ud;
struct skill_unit_group_tickset *set;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (group->interval==-1)
return NULL;
@@ -10352,7 +10352,7 @@ int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap)
if( !unit->alive || bl->prev == NULL )
return 0;
- nullpo_retr(0, group);
+ nullpo_ret(group);
if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP)) && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) )
return 0; //AoE skills are ineffective. [Skotlex]
@@ -10379,7 +10379,7 @@ static int skill_unit_timer_sub (DBKey key, void* data, va_list ap)
if( !unit->alive )
return 0;
- nullpo_retr(0, group);
+ nullpo_ret(group);
// check for expiration
if( (DIFF_TICK(tick,group->tick) >= group->limit || DIFF_TICK(tick,group->tick) >= unit->limit) )
@@ -10552,7 +10552,7 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap)
int skill_id;
int i;
- nullpo_retr(0, group);
+ nullpo_ret(group);
if( !unit->alive || target->prev == NULL )
return 0;
@@ -10653,7 +10653,7 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap)
*------------------------------------------*/
int skill_unit_move (struct block_list *bl, unsigned int tick, int flag)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if( bl->prev == NULL )
return 0;
@@ -10775,7 +10775,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
{
int i,j;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(nameid<=0)
return 0;
@@ -10832,7 +10832,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
int num = -1; // exclude the recipe
struct status_data *status;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
status = status_get_status_data(&sd->bl);
if( !(idx=skill_can_produce_mix(sd,nameid,-1, qty)) )
@@ -11175,7 +11175,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
int i,j,flag,index=-1;
struct item tmp_item;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(nameid <= 0)
return 1;
diff --git a/src/map/status.c b/src/map/status.c
index d2865f5fa..4dc84652a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1529,7 +1529,7 @@ int status_calc_mob_(struct mob_data* md, bool first)
//Skotlex: Calculates the stats of the given pet.
int status_calc_pet_(struct pet_data *pd, bool first)
{
- nullpo_retr(0, pd);
+ nullpo_ret(pd);
if (first) {
memcpy(&pd->status, &pd->db->status, sizeof(struct status_data));
@@ -4084,7 +4084,7 @@ static unsigned short status_calc_mode(struct block_list *bl, struct status_chan
const char* status_get_name(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC: return ((TBL_PC *)bl)->fakename[0] != '\0' ? ((TBL_PC*)bl)->fakename : ((TBL_PC*)bl)->status.name;
case BL_MOB: return ((TBL_MOB*)bl)->name;
@@ -4101,7 +4101,7 @@ const char* status_get_name(struct block_list *bl)
*------------------------------------------*/
int status_get_class(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch( bl->type )
{
case BL_PC: return ((TBL_PC*)bl)->status.class_;
@@ -4119,7 +4119,7 @@ int status_get_class(struct block_list *bl)
*------------------------------------------*/
int status_get_lv(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC: return ((TBL_PC*)bl)->status.base_level;
case BL_MOB: return ((TBL_MOB*)bl)->level;
@@ -4191,7 +4191,7 @@ unsigned short status_get_speed(struct block_list *bl)
int status_get_party_id(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC:
return ((TBL_PC*)bl)->status.party_id;
@@ -4227,7 +4227,7 @@ int status_get_party_id(struct block_list *bl)
int status_get_guild_id(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC:
return ((TBL_PC*)bl)->status.guild_id;
@@ -4265,7 +4265,7 @@ int status_get_guild_id(struct block_list *bl)
int status_get_emblem_id(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC:
return ((TBL_PC*)bl)->guild_emblem_id;
@@ -4304,7 +4304,7 @@ int status_get_emblem_id(struct block_list *bl)
int status_get_mexp(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(bl->type==BL_MOB)
return ((struct mob_data *)bl)->db->mexp;
if(bl->type==BL_PET)
@@ -4313,7 +4313,7 @@ int status_get_mexp(struct block_list *bl)
}
int status_get_race2(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(bl->type == BL_MOB)
return ((struct mob_data *)bl)->db->race2;
if(bl->type==BL_PET)
@@ -4323,7 +4323,7 @@ int status_get_race2(struct block_list *bl)
int status_isdead(struct block_list *bl)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
return status_get_status_data(bl)->hp == 0;
}
@@ -4513,7 +4513,7 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
struct status_change* sc;
struct map_session_data *sd;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
//Status that are blocked by Golden Thief Bug card or Wand of Hermod
if (status_isimmune(bl))
@@ -4692,7 +4692,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
struct view_data *vd;
int opt_flag, calc_flag, undead_flag;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sc = status_get_sc(bl);
status = status_get_status_data(bl);
@@ -6312,7 +6312,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
struct view_data *vd;
int opt_flag=0, calc_flag;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sc = status_get_sc(bl);
status = status_get_status_data(bl);
diff --git a/src/map/storage.c b/src/map/storage.c
index 1c06dfb70..8960f7203 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -92,7 +92,7 @@ void do_reconnect_storage(void)
*------------------------------------------*/
int storage_storageopen(struct map_session_data *sd)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->state.storage_flag)
return 1; //Already open?
@@ -207,7 +207,7 @@ int storage_delitem(struct map_session_data* sd, int n, int amount)
*------------------------------------------*/
int storage_storageadd(struct map_session_data* sd, int index, int amount)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->status.storage.storage_amount > MAX_STORAGE )
return 0; // storage full
@@ -256,7 +256,7 @@ int storage_storageget(struct map_session_data* sd, int index, int amount)
*------------------------------------------*/
int storage_storageaddfromcart(struct map_session_data* sd, int index, int amount)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( sd->status.storage.storage_amount > MAX_STORAGE )
return 0; // storage full / storage closed
@@ -281,7 +281,7 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun
*------------------------------------------*/
int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
{
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if( index < 0 || index >= MAX_STORAGE )
return 0;
@@ -358,7 +358,7 @@ int storage_guild_storageopen(struct map_session_data* sd)
{
struct guild_storage *gstor;
- nullpo_retr(0, sd);
+ nullpo_ret(sd);
if(sd->status.guild_id <= 0)
return 2;
@@ -460,8 +460,8 @@ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
{
struct guild_storage *stor;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
if( !stor->storage_status || stor->storage_amount > MAX_GUILD_STORAGE )
return 0;
@@ -487,8 +487,8 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
struct guild_storage *stor;
int flag;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
if(!stor->storage_status)
return 0;
@@ -515,8 +515,8 @@ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int
{
struct guild_storage *stor;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
if( !stor->storage_status || stor->storage_amount > MAX_GUILD_STORAGE )
return 0;
@@ -540,8 +540,8 @@ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int a
{
struct guild_storage *stor;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
if(!stor->storage_status)
return 0;
@@ -595,8 +595,8 @@ int storage_guild_storageclose(struct map_session_data* sd)
{
struct guild_storage *stor;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
clif_storageclose(sd);
if (stor->storage_status)
@@ -616,8 +616,8 @@ int storage_guild_storage_quit(struct map_session_data* sd, int flag)
{
struct guild_storage *stor;
- nullpo_retr(0, sd);
- nullpo_retr(0, stor=guild2storage2(sd->status.guild_id));
+ nullpo_ret(sd);
+ nullpo_ret(stor=guild2storage2(sd->status.guild_id));
if(flag)
{ //Only during a guild break flag is 1 (don't save storage)
diff --git a/src/map/unit.c b/src/map/unit.c
index fd89559f2..0c16977c1 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -281,7 +281,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
struct unit_data* ud = NULL;
struct status_change* sc = NULL;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
ud = unit_bl2ud(bl);
@@ -350,8 +350,8 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
{
struct unit_data *ud = NULL;
struct status_change *sc = NULL;
- nullpo_retr(0, bl);
- nullpo_retr(0, tbl);
+ nullpo_ret(bl);
+ nullpo_ret(tbl);
ud = unit_bl2ud(bl);
if( ud == NULL) return 0;
@@ -490,7 +490,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
struct unit_data *ud = NULL;
struct map_session_data *sd = NULL;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
sd = BL_CAST(BL_PC, bl);
ud = unit_bl2ud(bl);
@@ -547,7 +547,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
int unit_setdir(struct block_list *bl,unsigned char dir)
{
struct unit_data *ud;
- nullpo_retr( 0, bl );
+ nullpo_ret(bl );
ud = unit_bl2ud(bl);
if (!ud) return 0;
ud->dir = dir;
@@ -560,7 +560,7 @@ int unit_setdir(struct block_list *bl,unsigned char dir)
uint8 unit_getdir(struct block_list *bl)
{
struct unit_data *ud;
- nullpo_retr( 0, bl );
+ nullpo_ret(bl );
ud = unit_bl2ud(bl);
if (!ud) return 0;
return ud->dir;
@@ -572,7 +572,7 @@ uint8 unit_getdir(struct block_list *bl)
int unit_warp(struct block_list *bl,short m,short x,short y,int type)
{
struct unit_data *ud;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
ud = unit_bl2ud(bl);
if(bl->prev==NULL || !ud)
@@ -650,7 +650,7 @@ int unit_stop_walking(struct block_list *bl,int type)
struct unit_data *ud;
const struct TimerData* td;
unsigned int tick;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
ud = unit_bl2ud(bl);
if(!ud || ud->walktimer == -1)
@@ -700,7 +700,7 @@ int unit_skilluse_id(struct block_list *src, int target_id, short skill_num, sho
int unit_is_walking(struct block_list *bl)
{
struct unit_data *ud = unit_bl2ud(bl);
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(!ud) return 0;
return (ud->walktimer != -1);
}
@@ -714,7 +714,7 @@ int unit_can_move(struct block_list *bl)
struct unit_data *ud;
struct status_change *sc;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
ud = unit_bl2ud(bl);
sc = status_get_sc(bl);
sd = BL_CAST(BL_PC, bl);
@@ -840,7 +840,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
unsigned int tick = gettick();
int temp;
- nullpo_retr(0, src);
+ nullpo_ret(src);
if(status_isdead(src))
return 0; // 死んでいないか
@@ -1143,7 +1143,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
struct block_list bl;
unsigned int tick = gettick();
- nullpo_retr(0, src);
+ nullpo_ret(src);
if(!src->prev) return 0; // map 上に存在するか
if(status_isdead(src)) return 0;
@@ -1238,7 +1238,7 @@ static int unit_attack_timer(int tid, unsigned int tick, int id, intptr data);
int unit_stop_attack(struct block_list *bl)
{
struct unit_data *ud = unit_bl2ud(bl);
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if(!ud || ud->attacktimer == -1)
return 0;
@@ -1274,7 +1274,7 @@ int unit_attack(struct block_list *src,int target_id,int continuous)
struct block_list *target;
struct unit_data *ud;
- nullpo_retr(0, ud = unit_bl2ud(src));
+ nullpo_ret(ud = unit_bl2ud(src));
target = map_id2bl(target_id);
if( target==NULL || status_isdead(target) )
@@ -1336,7 +1336,7 @@ int unit_cancel_combo(struct block_list *bl)
return 0; //Combo wasn't active.
ud = unit_bl2ud(bl);
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
ud->attackabletime = gettick() + status_get_amotion(bl);
@@ -1404,7 +1404,7 @@ int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir)
{
int dx, dy, x, y, i, k;
struct unit_data *ud = unit_bl2ud(bl);
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
if( dir < 0 || dir > 7 )
return 1;
@@ -1603,7 +1603,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
unsigned int tick=gettick();
int ret=0, skill;
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
if (!ud || ud->skilltimer==-1)
return 0; //Nothing to cancel.
@@ -1695,7 +1695,7 @@ static int unit_counttargeted_sub(struct block_list* bl, va_list ap)
*------------------------------------------*/
int unit_counttargeted(struct block_list* bl, int target_lv)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
return (map_foreachinrange(unit_counttargeted_sub, bl, AREA_SIZE, BL_CHAR, bl->id, target_lv));
}
@@ -1704,7 +1704,7 @@ int unit_counttargeted(struct block_list* bl, int target_lv)
*------------------------------------------*/
int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2)
{
- nullpo_retr(0, target);
+ nullpo_ret(target);
if(damage+damage2 <= 0)
return 0;
@@ -1717,7 +1717,7 @@ int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int
*------------------------------------------*/
int unit_changeviewsize(struct block_list *bl,short size)
{
- nullpo_retr(0, bl);
+ nullpo_ret(bl);
size=(size<0)?-1:(size>0)?1:0;
@@ -1743,7 +1743,7 @@ int unit_remove_map_(struct block_list *bl, int clrtype, const char* file, int l
{
struct unit_data *ud = unit_bl2ud(bl);
struct status_change *sc = status_get_sc(bl);
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
if(bl->prev == NULL)
return 0; //Already removed?
@@ -1964,7 +1964,7 @@ void unit_free_pc(struct map_session_data *sd)
int unit_free(struct block_list *bl, int clrtype)
{
struct unit_data *ud = unit_bl2ud( bl );
- nullpo_retr(0, ud);
+ nullpo_ret(ud);
map_freeblock_lock();
if( bl->prev ) //Players are supposed to logout with a "warp" effect.