'evfactory del' should not delete other objects than environment controllers

This commit is contained in:
zolliker
2005-09-02 13:19:16 +00:00
parent 021b6f8486
commit b160049aa7

View File

@ -1412,14 +1412,13 @@ int RemoveEVController(SConnection *pCon, char *name) {
SCWrite(pCon,"ERROR: cannot delete while running",eError);
return 0;
}
EVUnregister(FindEMON(pServ->pSics),name);
iRet = RemoveCommand(pServ->pSics,name);
if(!iRet)
{
sprintf(pBueffel,"ERROR: %s not found, NOT deleted",name);
SCWrite(pCon,pBueffel,eError);
if (!FindCommandData(pServ->pSics, name, "Environment Controller")) {
SCPrintf(pCon,eError,"ERROR: no environment controller %s found",name);
return 0;
}
EVUnregister(FindEMON(pServ->pSics),name);
RemoveCommand(pServ->pSics,name);
return 1;
}
/*-------------------------------------------------------------------------