- create_object((GameObjectsType)(newtile-gameobjs_first_id),Vector(x,y));
-
- sector->update_game_objects();
+ int id = 0;
+ GameObject* object = 0;
+ for(Factories::iterator i = object_factories->begin(); i !=
+ object_factories->end(); ++i) {
+ if(id == newtile - gameobjs_first_id) {
+ object = create_object(i->first, Vector(x, y));
+ break;
+ }
+ id++;
+ }
+ if(object) {
+ sector->add_object(object);
+ sector->update_game_objects();
+ }