Skip to content

Commit 6a0bbd9

Browse files
committed
Soldiers don't have unitRules, fixes mind control crash.
1 parent 1598fe6 commit 6a0bbd9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Savegame/BattleUnit.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,11 @@ std::string BattleUnit::getMeleeWeapon()
27622762
{
27632763
return getItem("STR_LEFT_HAND")->getRules()->getType();
27642764
}
2765-
return _unitRules->getMeleeWeapon();
2765+
if (_unitRules != 0)
2766+
{
2767+
return _unitRules->getMeleeWeapon();
2768+
}
2769+
return "";
27662770
}
27672771

27682772
}

0 commit comments

Comments
 (0)