pawn-map icon indicating copy to clipboard operation
pawn-map copied to clipboard

Key not found after using MAP_remove_val on another key.

Open LukaMatkic opened this issue 2 years ago • 0 comments

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

LukaMatkic avatar Jan 09 '22 18:01 LukaMatkic