28 posts in this topic

I don't really see why you have to add the property.

in_process 

Since you turn it back to false in the same execution context/if block. Thanks btw!

Edited by Valiente

Share this post


Link to post
Share on other sites

I don't really see why you have to add the property.

in_process 

Since you turn it back to false in the same execution context/if block. Thanks btw!

int pc_takeitem_pre(struct map_session_data **sd_, struct flooritem_data **fitem_)
{
	struct area_p_data *data;
	struct map_session_data *sd = *sd_;
	struct flooritem_data *fitem = *fitem_;
	data = adb_search(sd);
	if (data->arealoot && data->in_process==false) {
		data->in_process = true;
		map->foreachinrange(skill->greed, &fitem->bl, arealoot_range, BL_ITEM, &sd->bl);
		hookStop();
		data->in_process = false;
		return 1;
	}
	return 1;
}

in_process is used in pc_takeitem preHook,

if you see in_process is set to true and it invokes skill->greed, skill->greed also invokes pc_takeitem, which would make it into possibility of infinite loop.

so to prevent this, I set in_process to true, so that the nested calls won't be executing foreachinrange(see if condition, it checks if in_process is false).

Share this post


Link to post
Share on other sites

Where I can see the complete guide to install this plugin?

I never had added a plugin before...

 

:/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now