Jump to content
  • 0

error: expected expression before ‘int’ while compiling


Poseidon

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  107
  • Reputation:   6
  • Joined:  12/09/11
  • Last Seen:  

Hi guys,

Ive been trying to add this to the end of script.c at line 23440

	int viewpointmap_sub(struct block_list *bl, va_list ap) {
	struct map_session_data *sd;
	int npc_id, type, x, y, id, color;
	npc_id = va_arg(ap, int);
	type = va_arg(ap, int);
	x = va_arg(ap, int);
	y = va_arg(ap, int);
	id = va_arg(ap, int);
	color = va_arg(ap, int);
	sd = (struct map_session_data *)bl;
	clif_viewpoint(sd, npc_id, type, x, y, id, color);

	return 0;

}

BUILDIN_FUNC(viewpointmap) {
	int type, x, y, id, color, m;
	const char *map_name;
	map_name = script_getstr(st, 2);

	if ((m = map_mapname2mapid(map_name)) < 0)
		return true; // Invalid Map

	type = script_getnum(st, 3);
	x = script_getnum(st, 4);
	y = script_getnum(st, 5);
	id = script_getnum(st, 6);
	color = script_getnum(st, 7);
	map_foreachinmap(viewpointmap_sub, m, BL_PC, st->oid, type, x, y, id, color);
	return true;
}


// Add this to the list of script commands defined, look through the code, should be self explanitory.
	BUILDIN_DEF(viewpointmap,"siiiii"),

but i receive this error

script.c:23441:2: error: expected expression before int
  int viewpointmap_sub(struct block_list *bl, va_list ap) {
  ^
Makefile:76: recipe for target 'obj/script.o' failed
make[1]: *** [obj/script.o] Error 1
make[1]: Leaving directory '/home/rob/rathena/src/map'
Makefile:51: recipe for target 'map' failed
make: *** [map] Error 2

the file i got the code from ask me to add the code anywhere in between BUILDING_FUNC's i believe i have done that but obviously i haven't as it is giving errors out while compiling on Ubuntu server

Any help will be appreciated

Kind regards

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