X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FTargetSelection.cpp;h=961f57cf845cdf703014c83345dc569803a231f9;hb=60e0fe29ce6cd033edc78b181d9d07fa72c11172;hp=42a88e4673b0444129fac3587564f090a578ee55;hpb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;p=l2e.git diff --git a/src/battle/TargetSelection.cpp b/src/battle/TargetSelection.cpp index 42a88e4..961f57c 100644 --- a/src/battle/TargetSelection.cpp +++ b/src/battle/TargetSelection.cpp @@ -67,6 +67,7 @@ void TargetSelection::MoveUp() { } void TargetSelection::MoveRight() { + assert(battle); if (TargetsMonsters()) { cursor = (cursor + 1) % battle->MaxMonsters(); while (!battle->MonsterPositionOccupied(cursor)) { @@ -78,6 +79,7 @@ void TargetSelection::MoveRight() { } void TargetSelection::MoveDown() { + assert(battle); if (TargetsMonsters()) { SelectHeroes(); return; @@ -89,6 +91,7 @@ void TargetSelection::MoveDown() { } void TargetSelection::MoveLeft() { + assert(battle); if (TargetsMonsters()) { cursor = (cursor + battle->MaxMonsters() - 1) % battle->MaxMonsters(); FindNextEnemy(); @@ -98,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();