Skip to content

Commit

Permalink
Properly check for empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Nov 13, 2015
1 parent 40f751c commit fb3954b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unit/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static int CclAcquireTrait(lua_State *l)
if (!strncmp(ident, "upgrade-", 8)) {
TraitAcquire(*unit, CUpgrade::Get(ident));
unit->Trait = ident;
} else if (ident == "") {
} else if (strlen(ident) == 0) {
if (!unit->Trait.empty()) { //remove previous trait, if any
if (!GameSettings.NoRandomness || unit->Type->BoolFlag[HERO_INDEX].value) { // if in no randomness setting, only change trait modifiers if the unit is a hero
IndividualUpgradeLost(*unit, CUpgrade::Get(unit->Trait));
Expand Down

0 comments on commit fb3954b

Please sign in to comment.