Posts: 1,208
Threads: 36
Joined: Apr 2015
CA_DestroyObject_DC -> check object type from ColAndreas Table -> DestroyObject/DestroyDynamicObject
PHP Code:
stock CA_DestroyObject_DC(index)
{
// Out of bounds
if(index < 0 || index >= MAX_CA_OBJECTS) return -1;
#if defined _Y_ITERATE_LOCAL_VERSION
if(Iter_Contains(CA_Objects, index))
{
new next;
Iter_SafeRemove(CA_Objects, index, next);
if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
#if defined STREAMER_TYPE_OBJECT
else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(CA_ObjectList[index][ObjectID]);
#endif
CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
return next;
}
#else
if(CA_ObjectList[index][ObjectUsed])
{
if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
#if defined STREAMER_TYPE_OBJECT
else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(CA_ObjectList[index][ObjectID]);
#endif
CA_ObjectList[index][ObjectUsed] = false;
CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
return 1;
}
#endif
return -1;
}
Posts: 1,208
Threads: 36
Joined: Apr 2015
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
It would be nice if someone cleaned up ColAndreas a bit at some point I don't really have time to get into it these days.
Posts: 1,208
Threads: 36
Joined: Apr 2015
Quote:
Originally Posted by Pottus
It would be nice if someone cleaned up ColAndreas a bit at some point I don't really have time to get into it these days.
|
I can do it
Posts: 1,208
Threads: 36
Joined: Apr 2015
CA_CreateDynamicObject_DC - create dynamic object, create collision object, return index
CA_DestroyObject_DC(index) - destroy object from index
If you need a streamer object id to use the function SetDynamicObjectMaterial, ModeDynamicObject you need wait for:
PHP Code:
CA_GetObjectID(index);
https://github.com/Pottus/ColAndreas/pull/30
Also check your logs about plugin errors.