Skip to content

Commit fb3954b

Browse files
committed
Properly check for empty string
1 parent 40f751c commit fb3954b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unit/upgrade.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static int CclAcquireTrait(lua_State *l)
546546
if (!strncmp(ident, "upgrade-", 8)) {
547547
TraitAcquire(*unit, CUpgrade::Get(ident));
548548
unit->Trait = ident;
549-
} else if (ident == "") {
549+
} else if (strlen(ident) == 0) {
550550
if (!unit->Trait.empty()) { //remove previous trait, if any
551551
if (!GameSettings.NoRandomness || unit->Type->BoolFlag[HERO_INDEX].value) { // if in no randomness setting, only change trait modifiers if the unit is a hero
552552
IndividualUpgradeLost(*unit, CUpgrade::Get(unit->Trait));

0 commit comments

Comments
 (0)