Skip to content

Commit

Permalink
Let componentAvailable() return true for redundant components.
Browse files Browse the repository at this point in the history
  • Loading branch information
KJeff01 committed Apr 16, 2019
1 parent 4b2a947 commit 0b535c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qtscriptfuncs.cpp
Expand Up @@ -1682,7 +1682,8 @@ static QScriptValue js_componentAvailable(QScriptContext *context, QScriptEngine
QString id = (context->argumentCount() == 1) ? context->argument(0).toString() : context->argument(1).toString();
COMPONENT_STATS *psComp = getCompStatsFromName(WzString::fromUtf8(id.toUtf8().constData()));
SCRIPT_ASSERT(context, psComp, "No such component: %s", id.toUtf8().constData());
return QScriptValue(apCompLists[player][psComp->compType][psComp->index] == AVAILABLE);
int status = apCompLists[player][psComp->compType][psComp->index];
return QScriptValue(status == AVAILABLE || status == REDUNDANT);
}

//-- ## addFeature(name, x, y)
Expand Down

0 comments on commit 0b535c8

Please sign in to comment.