| 05-10-2005, 07:12 PM | #1 |
Finally I have a confirmed case of DestroyForce completely fucking up a trigger. I had a very similar problem months (or almost years) ago but nobody was ever able to confirm my findings. But now, finally, Rod also found out about this really evil bug that may occur when you try to clean up force variables (using DestroyForce). His code was something like this: Code:
if (IsPlayerInForce(GetLocalPlayer(), f)) then ... endif call DestroyForce(f) //VERY VERY BAD set f = null Where f was a local force variable. Anyway calling this function once didn't actually result in a thread crash but it prevented the same function from reexecuting if called again after that. It's rather strange and rare (considering only 2 people have experienced it by now). I also don't know if it will happen whenever DestroyFunction is called. I'm just pointing it out because it's a pisser to find such a crazy bug when your code doesn't work and you don't know why. You should just be aware of this and try to avoid forces, usually they are not needed anyway. |
| 05-14-2005, 09:34 PM | #2 |
What type of force was f in that function? |
| 05-15-2005, 12:35 AM | #3 |
I used destroyforce too much times without experiencing this, Are you sure you weren't destroying an already destroyed force? |
| 05-16-2005, 03:28 PM | #4 | |
Quote:
Pretty sure. I can post the whole script later. |
