]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
extracted map loading/unloading
[l2e.git] / src / main.cpp
index 2a49ad585f50c09a8d5e487dc9bba6adf5b06079..c4bc0bfb378d76ab9cba18f990a3814d362dc7f3 100644 (file)
@@ -543,6 +543,7 @@ int main(int argc, char **argv) {
                mapMonster.SetAnimation(&mapMonsterAnimation);
                mapMonster.Position() = Vector<float>(64, 32);
                mapMonster.SetOrientation(Entity::ORIENTATION_SOUTH);
+               map1.SetEntities(&mapMonster, 1);
 
                InitScreen screen(width, height);
 
@@ -562,15 +563,8 @@ int main(int argc, char **argv) {
                } else {
                        MapState *mapState(new MapState(&map1));
 
-                       mapState->AddEntity(&mapMaxim);
-                       mapState->AddEntity(&mapSelan);
-                       mapState->AddEntity(&mapGuy);
-                       mapState->AddEntity(&mapDekar);
-
                        mapState->ControlEntity(&mapMaxim);
                        mapState->SetWalkingSpeed(walkSpeed);
-
-                       mapState->AddEntity(&mapMonster);
                        mapMonster.StartAnimation(*mapState);
 
                        state = mapState;