]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/MapState.cpp
lousy implementation of "array of identifiers" type
[l2e.git] / src / map / MapState.cpp
index 5ec95071963cbfccac3f3920b3ffc0c1ca56343d..d678dab965d573c7722a963a9cc5936ac57af5c6 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * MapState.cpp
- *
- *  Created on: Sep 29, 2012
- *      Author: holy
- */
-
 #include "MapState.h"
 
 #include "Map.h"
@@ -17,6 +10,7 @@
 #include "../common/GameConfig.h"
 #include "../common/GameState.h"
 #include "../graphics/ColorFade.h"
+#include "../menu/PartyMenu.h"
 
 #include <algorithm>
 
@@ -26,6 +20,7 @@ using battle::BattleState;
 using common::GameConfig;
 using geometry::Vector;
 using graphics::ColorFade;
+using menu::PartyMenu;
 
 namespace map {
 
@@ -69,6 +64,11 @@ void MapState::OnResize(int width, int height) {
 
 
 void MapState::HandleEvents(const Input &input) {
+       if (input.JustPressed(Input::ACTION_X)) {
+               Ctrl().PushState(new PartyMenu(game));
+               return;
+       }
+
        if (!controlled) return;
 
        if (input.IsDown(Input::PAD_UP)) {
@@ -296,8 +296,8 @@ bool MapState::CheckMonster() {
                                                battleState->AddHero(*game->state->party[i]);
                                        }
                                }
-                               for (battle::Monster *monster((*e)->MonstersBegin()); monster != (*e)->MonstersEnd(); ++monster) {
-                                       battleState->AddMonster(*monster);
+                               for (battle::Monster **monster((*e)->MonstersBegin()); monster != (*e)->MonstersEnd(); ++monster) {
+                                       battleState->AddMonster(**monster);
                                }
 
                                ColorFade *fadeIn(new ColorFade(this, 0, 500, true));