Ok, here is a revised version of my above code that should clarify what Im TRYING to do...
...
if(my)
{
sys_marker("se6");
logNewValue("mE", me, debugLog, OFF);
logNewValue("mY", my, debugLog, OFF);
sys_marker("se7"); ENTITY* tmpE;
for(tmpE=ent_next(NULL); tmpE; tmpE=ent_next(tmpE))
{ if(tmpE==me)
{ ent_remove(me);
me = -1;
break;
}
}
if(me != -1) { error("entity not found ... dead?"); }
}
sys_marker("se8");
}
Beware of possibly flawed logic, but what Im trying to do is as follows...
The FOR loop is checking through all VALID entities.
If it finds a match to ME, then it ent)remove's ME and exits the loop.
The IF following the loop is meant to detect if the loop found ME and removed it,
or if it 'fell through' by not finding ME within all valid entities.
I havent tested this code at all, so I dont know if the "me = -1;" may need
re-casting, with something like "me = (ENTITY*)-1;".