- Joined
- Nov 22, 2006
- Messages
- 28
Ok, here´s my problem: i created a maul and need to save some extra vars for each creep. So i give every unit a unique costum value (resetet after each round). So i can save whatever i want - variable["costum value of picked unit"].
I also created a anti-stuck and block system. If a unit stands to long at one point it will teleport. Every 4 seconds it picks every creep and saves the postion. Then i can compare the latest saved position with the current positon. If the distance is to short it will be "marked" for teleport or gets new orders.
So far it´s quite simple. But i have problems with saving the position. First i save the current position of the picked creep as temp_point. Then it checks the distance and then it sets unit_position[costum value] = temp_point. Then i remove the temp_point with the WEU function to prevent leaks - but it also removes the currently saved unit_position[costum value] . I don´t know why. I guess it´s some kind of bug.
Next thing i tried was to save the x and y coordinates as integer. That worked but leaks. Any ideas?
I also created a anti-stuck and block system. If a unit stands to long at one point it will teleport. Every 4 seconds it picks every creep and saves the postion. Then i can compare the latest saved position with the current positon. If the distance is to short it will be "marked" for teleport or gets new orders.
So far it´s quite simple. But i have problems with saving the position. First i save the current position of the picked creep as temp_point. Then it checks the distance and then it sets unit_position[costum value] = temp_point. Then i remove the temp_point with the WEU function to prevent leaks - but it also removes the currently saved unit_position[costum value] . I don´t know why. I guess it´s some kind of bug.
Next thing i tried was to save the x and y coordinates as integer. That worked but leaks. Any ideas?