summaryrefslogtreecommitdiff
path: root/src/cat/CommandInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cat/CommandInterface.cpp')
-rw-r--r--src/cat/CommandInterface.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cat/CommandInterface.cpp b/src/cat/CommandInterface.cpp
index 240e7e4..3ebc795 100644
--- a/src/cat/CommandInterface.cpp
+++ b/src/cat/CommandInterface.cpp
@@ -96,16 +96,16 @@ int CommandInterface::GetParticleType(std::string type)
Element * elements = m->GetSimulation()->elements;
// alternative names for some elements
- if (strcasecmp(txt,"C4")==0) i = PT_PLEX;
- else if (strcasecmp(txt,"C5")==0) i = PT_C5;
- else if (strcasecmp(txt,"NONE")==0) i = PT_NONE;
+ if (strcasecmp(txt,"C4")==0) return PT_PLEX;
+ else if (strcasecmp(txt,"C5")==0) return PT_C5;
+ else if (strcasecmp(txt,"NONE")==0) return PT_NONE;
for (i=1; i<PT_NUM; i++) {
if (strcasecmp(txt, elements[i].Name)==0 && elements[i].Enabled)
{
return i;
}
}
- return i;
+ return -1;
}
std::string CommandInterface::GetLastError()