]> git.localhorst.tv Git - l2e.git/commitdiff
lousy but working implementation of spell swapping
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 18 Nov 2012 16:15:19 +0000 (17:15 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 18 Nov 2012 16:21:22 +0000 (17:21 +0100)
src/menu/SpellMenu.cpp

index 3be722bffa550313b9005d408a166268bb68b329..57989ed2a9396e659fc0fa5cb5a416f0830d0b94 100644 (file)
@@ -132,7 +132,8 @@ void SpellMenu::HandleEvents(const Input &input) {
                                // TODO: use spell
                        }
                } else {
-                       // TODO: swap spells
+                       std::swap(GetHero().Spells().at(spellMenu.SelectedIndex()),
+                                       GetHero().Spells().at(spellMenu.SecondaryIndex()));
                        spellMenu.SwapSelected();
                        spellMenu.SetActive();
                }