mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-04 10:34:01 +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()
|
void SceneEditor::doPrevElement()
|
||||||
{
|
{
|
||||||
int oldCur = curElement;
|
size_t oldCur = curElement;
|
||||||
curElement--;
|
size_t maxn = dsq->game->elementTemplates.size();
|
||||||
if (curElement >= game->elementTemplates.size())
|
|
||||||
curElement = dsq->game->elementTemplates.size()-1;
|
|
||||||
|
|
||||||
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);
|
placer->setTexture(dsq->game->elementTemplates[curElement].gfx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue