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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user