mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-01 00:45:26 +02:00
small cleanup
This commit is contained in:
@ -659,23 +659,23 @@ void CGameState::randomizeObject(CGObjectInstance *cur)
|
|||||||
{
|
{
|
||||||
if(cur->ID==Obj::TOWN)
|
if(cur->ID==Obj::TOWN)
|
||||||
cur->setType(cur->ID, cur->subID); // update def, if necessary
|
cur->setType(cur->ID, cur->subID); // update def, if necessary
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if(ran.first==Obj::HERO)//special code for hero
|
else if(ran.first==Obj::HERO)//special code for hero
|
||||||
{
|
{
|
||||||
CGHeroInstance *h = dynamic_cast<CGHeroInstance *>(cur);
|
CGHeroInstance *h = dynamic_cast<CGHeroInstance *>(cur);
|
||||||
cur->setType(ran.first, ran.second);
|
cur->setType(ran.first, ran.second);
|
||||||
map->heroesOnMap.push_back(h);
|
map->heroesOnMap.push_back(h);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if(ran.first==Obj::TOWN)//special code for town
|
else if(ran.first==Obj::TOWN)//special code for town
|
||||||
{
|
{
|
||||||
CGTownInstance *t = dynamic_cast<CGTownInstance*>(cur);
|
CGTownInstance *t = dynamic_cast<CGTownInstance*>(cur);
|
||||||
cur->setType(ran.first, ran.second);
|
cur->setType(ran.first, ran.second);
|
||||||
map->towns.push_back(t);
|
map->towns.push_back(t);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
cur->setType(ran.first, ran.second);
|
cur->setType(ran.first, ran.second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CGameState::getDate(Date::EDateType mode) const
|
int CGameState::getDate(Date::EDateType mode) const
|
||||||
|
Reference in New Issue
Block a user