mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge pull request #5940 from Laserlicht/case_insensitive
case insensitive cheat identifier
This commit is contained in:
@@ -427,7 +427,7 @@ void PlayerMessageProcessor::cheatGiveArmy(PlayerColor player, const CGHeroInsta
|
||||
{
|
||||
}
|
||||
|
||||
std::optional<int32_t> creatureId = LIBRARY->identifiers()->getIdentifier(ModScope::scopeGame(), "creature", creatureIdentifier, false);
|
||||
std::optional<int32_t> creatureId = LIBRARY->identifiers()->getIdentifierCaseInsensitive(ModScope::scopeGame(), "creature", creatureIdentifier, false);
|
||||
|
||||
if(creatureId.has_value())
|
||||
{
|
||||
@@ -468,7 +468,7 @@ void PlayerMessageProcessor::cheatGiveArtifacts(PlayerColor player, const CGHero
|
||||
{
|
||||
for (auto const & word : words)
|
||||
{
|
||||
auto artID = LIBRARY->identifiers()->getIdentifier(ModScope::scopeGame(), "artifact", word, false);
|
||||
auto artID = LIBRARY->identifiers()->getIdentifierCaseInsensitive(ModScope::scopeGame(), "artifact", word, false);
|
||||
if(artID && LIBRARY->arth->objects[*artID])
|
||||
gameHandler->giveHeroNewArtifact(hero, ArtifactID(*artID), ArtifactPosition::FIRST_AVAILABLE);
|
||||
}
|
||||
@@ -727,7 +727,7 @@ void PlayerMessageProcessor::cheatSkill(PlayerColor player, const CGHeroInstance
|
||||
return;
|
||||
}
|
||||
|
||||
std::optional<int32_t> skillId = LIBRARY->identifiers()->getIdentifier(ModScope::scopeGame(), "skill", identifier, false);
|
||||
std::optional<int32_t> skillId = LIBRARY->identifiers()->getIdentifierCaseInsensitive(ModScope::scopeGame(), "skill", identifier, false);
|
||||
if(!skillId.has_value())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user