- better error message on null resource

This commit is contained in:
Mark Vejvoda 2011-04-26 22:11:18 +00:00
parent 47ef05ceed
commit 8d3a53235a
1 changed files with 2 additions and 2 deletions

View File

@ -470,9 +470,9 @@ void Faction::applyStaticCosts(const ProducibleType *p) {
//decrease static resources
for(int i=0; i<p->getCostCount(); ++i) {
const ResourceType *rt= p->getCost(i)->getType();
assert(rt != NULL);
//assert(rt != NULL);
if(rt == NULL) {
throw runtime_error("rt == NULL");
throw runtime_error("rt == NULL - " + p->getName());
}
if(rt->getClass() == rcStatic) {
int cost= p->getCost(i)->getAmount();