1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-12 17:29:54 +00:00

Fix some more warnings

This commit is contained in:
Valentin Ochs 2017-01-14 18:23:53 +01:00
parent fe0ab0418b
commit 4dc7e27ee6
11 changed files with 24 additions and 29 deletions

View file

@ -1468,7 +1468,7 @@ void SceneEditor::mouseButtonLeft()
{
Path *p = getSelectedPath();
editingPath = p;
if (p && selectedNode >= 0 && selectedNode < p->nodes.size())
if (p && selectedNode < p->nodes.size())
{
if (core->getShiftState())
{
@ -2317,7 +2317,7 @@ void nextEntityPage()
void prevEntityPage()
{
game->sceneEditor.entityPageNum--;
if (game->sceneEditor.entityPageNum < 0)
if (game->sceneEditor.entityPageNum >= game->entityGroups.size())
game->sceneEditor.entityPageNum = game->entityGroups.size()-1;
createEntityPage();
@ -2540,12 +2540,9 @@ void SceneEditor::doPrevElement()
{
int oldCur = curElement;
curElement--;
if (curElement < 0)
if (curElement >= game->elementTemplates.size())
curElement = dsq->game->elementTemplates.size()-1;
if (curElement < 0)
return;
if (dsq->game->elementTemplates[curElement].idx < 1024)
{
placer->setTexture(dsq->game->elementTemplates[curElement].gfx);
@ -3106,8 +3103,7 @@ void SceneEditor::update(float dt)
}
break;
case ES_MOVING:
if (selectedIdx >= 0)
dsq->game->getPath(selectedIdx)->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset;
dsq->game->getPath(selectedIdx)->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset;
break;
case ES_ROTATING:
case ES_MAX: