Any thoughts about this? The weird thing is, when I remove the entity/model wit this function:
function DeleteModel(MODEL* model)
{
if(!model)return 0;
if(model->entity)
{
switch(model->entity.skill2)
{
case 1:
ACTOR[model->entity.skill1] = NULL;
actor_count--;
break;
case 2:
MAP_TERRAIN[model->entity.skill1] = NULL;
terrain_count--;
break;
case 3:
ALIGHT[model->entity.skill1] = NULL;
light_count--;
break;
case 4:
PORTAL[model->entity.skill1] = NULL;
portal_count--;
break;
case 5:
WATER[model->entity.skill1] = NULL;
water_count--;
break;
}
ptr_remove(model->entity);
}
model_count--;
if(model->mesh)ptr_remove(model->mesh);
memset(model,0,sizeof(MODEL));
free(model);
return 1;
}
The entity is deleted as should, however the visible entities also decrease by two.