1
General / Re: Deleting objects
« on: July 18, 2013, 03:40:29 pm »
I hear what you are saying. Thanks!
Ill try and fix that,and hopefully will learn RAII asap
Ill try and fix that,and hopefully will learn RAII asap
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int DeadAlive = Dragon->TestIfDead();
MonPtr = Tail;
if(DeadAlive == true)
{
if(Tail == Dragon){
MonPtr = Dragon;
Dragon = Dragon->Node;
free(MonPtr);
delete MonPtr;
}
else if(Dragon->Node == NULL){
MonPtr = Dragon;
Dragon = Tail;
free(MonPtr);
delete MonPtr;
}
else{
for(short NDC = 0; NDC < DC; NDC++){
MonPtr = MonPtr->Node;
if(NDC + 1 == DC){
Dragon = MonPtr;
Dragon->Node = Dragon->Node->Node;
}
}
free(MonPtr);
delete MonPtr;
}
}
while (window.isOpen())loop?
_BLOCK_TYPE_IS_VALID (pHead->nBlockUse).