Skip to content
Permalink
Browse files
Out of ID range protectors for Blocks/BGO/NPC
  • Loading branch information
Wohlstand committed Jun 1, 2014
1 parent b128750 commit 7711965b68beb6cced9ec130f8cd70323ede32a3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
@@ -229,6 +229,10 @@ void LvlScene::placeBlock(LevelBlock &block, bool toGrid)
{
//if(block.id==89) WriteToLog(QtDebugMsg, QString("Block 89 is %1, %2").arg(noimage).arg(tImg.isNull()));
tImg = uBlockImg;
if(j >= pConfigs->main_block.size())
{
j=0;
}
}

BlockImage->setBlockData(block, pConfigs->main_block[j].sizable);
@@ -372,6 +376,10 @@ void LvlScene::placeBGO(LevelBGO &bgo, bool toGrid)
if((noimage)||(tImg.isNull()))
{
tImg=uBgoImg;
if(j >= pConfigs->main_bgo.size())
{
j=0;
}
}

BGOItem->setBGOData(bgo);
@@ -520,6 +528,11 @@ void LvlScene::placeNPC(LevelNPC &npc, bool toGrid)
if((noimage)||(tImg.isNull()))
{
tImg=uNpcImg;
if(j >= pConfigs->main_npc.size())
{
j=0;
mergedSet = pConfigs->main_npc[j];
}
}


@@ -84,6 +84,10 @@ void MainWindow::LvlItemProps(int Type, LevelBlock block, LevelBGO bgo, LevelNPC
break;
}
}
if(j >= configs.main_block.size())
{
j=0;
}

ui->PROPS_blockPos->setText( tr("Position: [%1, %2]").arg(block.x).arg(block.y) );
ui->PROPS_BlockResize->setVisible( configs.main_block[j].sizable );
@@ -193,6 +197,11 @@ void MainWindow::LvlItemProps(int Type, LevelBlock block, LevelBGO bgo, LevelNPC
}
}

if(j >= configs.main_npc.size())
{
j=0;
}

ui->PROPS_NPCContaiter->hide();

ui->PROPS_NPCBoxLabel->hide();

0 comments on commit 7711965

Please sign in to comment.