X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FTargetSelection.cpp;h=961f57cf845cdf703014c83345dc569803a231f9;hb=60e0fe29ce6cd033edc78b181d9d07fa72c11172;hp=876933061528176eebd3837b1fb50605f314fc39;hpb=fde7b27297882a7f033641df92e732abd137b532;p=l2e.git diff --git a/src/battle/TargetSelection.cpp b/src/battle/TargetSelection.cpp index 8769330..961f57c 100644 --- a/src/battle/TargetSelection.cpp +++ b/src/battle/TargetSelection.cpp @@ -1,10 +1,3 @@ -/* - * TargetSelection.cpp - * - * Created on: Aug 9, 2012 - * Author: holy - */ - #include "TargetSelection.h" #include "BattleState.h" @@ -74,6 +67,7 @@ void TargetSelection::MoveUp() { } void TargetSelection::MoveRight() { + assert(battle); if (TargetsMonsters()) { cursor = (cursor + 1) % battle->MaxMonsters(); while (!battle->MonsterPositionOccupied(cursor)) { @@ -85,6 +79,7 @@ void TargetSelection::MoveRight() { } void TargetSelection::MoveDown() { + assert(battle); if (TargetsMonsters()) { SelectHeroes(); return; @@ -96,6 +91,7 @@ void TargetSelection::MoveDown() { } void TargetSelection::MoveLeft() { + assert(battle); if (TargetsMonsters()) { cursor = (cursor + battle->MaxMonsters() - 1) % battle->MaxMonsters(); FindNextEnemy(); @@ -105,6 +101,7 @@ void TargetSelection::MoveLeft() { } void TargetSelection::FindNextEnemy() { + assert(battle); int start(cursor); while (!battle->MonsterPositionOccupied(cursor)) { cursor = (cursor + battle->MaxMonsters() - 1) % battle->MaxMonsters();