Преглед изворни кода

Replaced all nullpo_retr() calls which returned 0 with nullpo_ret() calls.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14414 54d463be-8e91-2dee-dedb-b68131a5f0ec
Paradox924X пре 14 година
родитељ
комит
2f9e3dbf81
22 измењених фајлова са 464 додато и 464 уклоњено
  1. 5 5
      src/map/atcommand.c
  2. 6 6
      src/map/battle.c
  3. 3 3
      src/map/battleground.c
  4. 8 8
      src/map/chat.c
  5. 125 125
      src/map/clif.c
  6. 28 28
      src/map/guild.c
  7. 7 7
      src/map/homunculus.c
  8. 4 4
      src/map/intif.c
  9. 2 2
      src/map/itemdb.c
  10. 7 7
      src/map/log.c
  11. 3 3
      src/map/mail.c
  12. 7 7
      src/map/map.c
  13. 27 27
      src/map/mob.c
  14. 19 19
      src/map/npc.c
  15. 7 7
      src/map/party.c
  16. 77 77
      src/map/pc.c
  17. 8 8
      src/map/pet.c
  18. 2 2
      src/map/quest.c
  19. 67 67
      src/map/skill.c
  20. 13 13
      src/map/status.c
  21. 17 17
      src/map/storage.c
  22. 22 22
      src/map/unit.c

+ 5 - 5
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);

+ 6 - 6
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;
 

+ 3 - 3
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 )

+ 8 - 8
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);

Разлика између датотеке није приказан због своје велике величине
+ 125 - 125
src/map/clif.c


+ 28 - 28
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 );

+ 7 - 7
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

+ 4 - 4
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;

+ 2 - 2
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:

+ 7 - 7
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 )

+ 3 - 3
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;

+ 7 - 7
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:

+ 27 - 27
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)

+ 19 - 19
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 )
 	{

+ 7 - 7
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;

+ 77 - 77
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;

+ 8 - 8
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));
 

+ 2 - 2
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);

+ 67 - 67
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;

+ 13 - 13
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);

+ 17 - 17
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)

+ 22 - 22
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.

Неке датотеке нису приказане због велике количине промена