14.01.2014, 02:03
Well, as I said, there's not much I can do if I'm unable to reproduce it myself. Try doing some debug prints to see if you can narrow down exactly where the problem originates in your code.
I'll add something. I'm not saying this is definitely a scripting issue, because there could very well be a bug in the plugin, but this is an easy mistake to make:
The lesson here is to always reset any variable holding an object ID to 0 immediately after DestroyDynamicObject is called. All object IDs start at 1, so calling DestroyDynamicObject with a variable set to 0 will simply do nothing.
I'll add something. I'm not saying this is definitely a scripting issue, because there could very well be a bug in the plugin, but this is an easy mistake to make:
pawn Код:
// This is a global variable that gets initialized in some function to create a road object.
// Let's say this variable is equal to 100 (that is, the object ID is 100).
road = CreateDynamicObject(...);
// The global variable is used in some function to destroy the road object.
// However, the variable is still equal to 100.
DestroyDynamicObject(road);
// Another global variable gets initialized in some function to create a bridge object.
// Since the road object was just destroyed, this variable is also equal to 100.
bridge = CreateDynamicObject(...);
// The function that destroys the road object is called again before another road object is created.
// Although the road object no longer exists, both the "road" and "bridge" variables are still equivalent.
// Therefore, the bridge object gets destroyed.
DestroyDynamicObject(road);