1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #3188 from IvanSavenko/remove_identifier_implicit_int_conversion2

Remove implicit conversion of identifier to integer
This commit is contained in:
Ivan Savenko
2023-11-16 17:26:32 +02:00
committed by GitHub
128 changed files with 605 additions and 1135 deletions

View File

@@ -1218,12 +1218,12 @@ void RemoveObject::applyGs(CGameState *gs)
{
if (cond.object == obj)
{
if (cond.condition == EventCondition::DESTROY || cond.condition == EventCondition::DESTROY_0)
if (cond.condition == EventCondition::DESTROY)
{
cond.condition = EventCondition::CONST_VALUE;
cond.value = 1; // destroyed object, from now on always fulfilled
}
else if (cond.condition == EventCondition::CONTROL || cond.condition == EventCondition::HAVE_0)
else if (cond.condition == EventCondition::CONTROL)
{
cond.condition = EventCondition::CONST_VALUE;
cond.value = 0; // destroyed object, from now on can not be fulfilled
@@ -1971,9 +1971,9 @@ void HeroVisit::applyGs(CGameState *gs)
void SetAvailableArtifacts::applyGs(CGameState * gs) const
{
if(id >= 0)
if(id != ObjectInstanceID::NONE)
{
if(auto * bm = dynamic_cast<CGBlackMarket *>(gs->map->objects[id].get()))
if(auto * bm = dynamic_cast<CGBlackMarket *>(gs->getObjInstance(id)))
{
bm->artifacts = arts;
}