mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-24 17:26:41 +00:00
Fix crash on startup
This commit is contained in:
parent
6af1fd10e1
commit
812848e382
1 changed files with 11 additions and 5 deletions
|
@ -2538,12 +2538,18 @@ void SceneEditor::prevElement()
|
|||
|
||||
void SceneEditor::doPrevElement()
|
||||
{
|
||||
int oldCur = curElement;
|
||||
curElement--;
|
||||
if (curElement >= game->elementTemplates.size())
|
||||
curElement = dsq->game->elementTemplates.size()-1;
|
||||
size_t oldCur = curElement;
|
||||
size_t maxn = dsq->game->elementTemplates.size();
|
||||
|
||||
if (dsq->game->elementTemplates[curElement].idx < 1024)
|
||||
if(curElement)
|
||||
curElement--;
|
||||
else if(maxn)
|
||||
curElement = maxn-1;
|
||||
|
||||
if (maxn && curElement >= maxn)
|
||||
curElement = maxn-1;
|
||||
|
||||
if (maxn && dsq->game->elementTemplates[curElement].idx < 1024)
|
||||
{
|
||||
placer->setTexture(dsq->game->elementTemplates[curElement].gfx);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue