Jump to content
  • 0

make compatible


fictionx

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

I have an error when i try to install this code.

// Returns the count of all the monsters on the specified map with the given monster id.
// mobcount2 <map>,<mob id>;
static int buildin_mobcount2_sub(struct block_list *bl,va_list ap)
{
	int class_=va_arg(ap,int);
	struct mob_data *md = ((struct mob_data *)bl);
	if(md->class_ == class_ && md->status.hp > 0)
		return 1;
	return 0;
}

BUILDIN_FUNC(mobcount2)
{
	const char *mapname;
	int class_,m;
	mapname=script_getstr(st,2);
	class_=script_getnum(st,3);

if(!mobdb_checkid(class_)) {
		script_pushint(st,-1);
		return 0;
	}
	if((m = map_mapname2mapid(mapname)) < 0) {
		script_pushint(st,-1);
		return 0;
	}
	if(map[m].flag.src4instance && map[m].instance_id == 0 && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0)
	{
		script_pushint(st,-1);
		return 0;
	}
	script_pushint(st,map_foreachinmap(buildin_mobcount2_sub,m,BL_MOB,class_));
	return 0;
}

 this is the error

 

script.c: In function ‘buildin_mobcount2_sub’:
script.c:4826: error: ‘struct mob_data’ has no member named ‘class_’
script.c: In function ‘buildin_mobcount2’:
script.c:4846: error: ‘struct map_flag’ has no member named ‘src4instance’
script.c:4846: error: ‘struct script_state’ has no member named ‘instance_id’
script.c:4846: warning: implicit declaration of function ‘instance_mapid2imapid’
script.c:4846: error: ‘struct script_state’ has no member named ‘instance_id’

bump

Edited by fictionx
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...