Sanity check

Throw out degenerated items. «*»= static void sanityCheck(Map *map) int i,j; Section *sec; Item *it;

for(j=0;j<map->sectionNum;j++) sec=&map->sections[j]; for(i=0;i<sec->itemNum;i++) it=&sec->items[i]; switch(it->type) case LOCATION: if(it->bounds.extent.x<=0 || it->bounds.extent.y<=0) if(prefs.verbose) FrmCustomAlert(InfoDialog,"Deleting Null Loc","",""); DeleteItem(sec,it); if(it->itemdata.loc.Name==NULL) if(prefs.verbose) FrmCustomAlert(InfoDialog,"Null Name in Loc","",""); it->itemdata.loc.Name=MemPtrNew(4); StrCopy(it->itemdata.loc.Name,"New"); if(it->itemdata.loc.Desc==NULL) if(prefs.verbose) FrmCustomAlert(InfoDialog,"Invalid Desc in Loc","",""); it->itemdata.loc.Desc=MemPtrNew(1); *it->itemdata.loc.Desc=''; break; case CONNECTION: if(it->itemdata.con.vertexnum<2) if(prefs.verbose) FrmCustomAlert(InfoDialog,"Deleting Null Vertex","",""); DeleteItem(sec,it); break; case TEXT: if(it->itemdata.text.text==NULL) if(prefs.verbose) FrmCustomAlert(InfoDialog,"Deleting Invalid Text","",""); it->itemdata.text.text=MemPtrNew(1); *it->itemdata.text.text=''; break; default: DeleteItem(sec,it); break; @