Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key not found after using MAP_remove_val on another key. #12

Open
LukaMatkic opened this issue Jan 9, 2022 · 0 comments
Open

Key not found after using MAP_remove_val on another key. #12

LukaMatkic opened this issue Jan 9, 2022 · 0 comments

Comments

@LukaMatkic
Copy link

Hy,
first I want to thank you for this awesome plugin. I have been using it in my new SA:MP mode im working on...
I found bug in plugin, after using MAP_remove_val with some key, another key from map becomes unavaliable too...

Example:

static DoTestMap()
{
	new Map:TestMap;

	MAP_insert_val_val(TestMap, 19, 2);
	MAP_insert_val_val(TestMap, 20, 3);
	MAP_insert_val_val(TestMap, 22, 4);
	MAP_insert_val_val(TestMap, 23, 5);
	MAP_insert_val_val(TestMap, 24, 6);
	MAP_insert_val_val(TestMap, 25, 7);

	MAP_remove_val(TestMap, 22);
	printf("map contains 24 [%d]", MAP_contains_val(TestMap, 24));
	MAP_insert_val_val(TestMap, 22, 4);
	printf("map contains 24 [%d]", MAP_contains_val(TestMap, 24));
	MAP_remove_val(TestMap, 23);
        // After removing key 23, key 24 starts to become unavaliable too...
	printf("map contains 24 [%d]", MAP_contains_val(TestMap, 24));
	MAP_insert_val_val(TestMap, 23, 5);
	printf("map contains 24 [%d]", MAP_contains_val(TestMap, 24));

}

Are you still maintaining this plugin ? Im not sure if I will be able to fix this problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant