Fix issue with action not being updated when typing grow()/fire()/etc in console...
[supertux.git] / src / object / ispy.cpp
index 60fbfc9..09a7367 100644 (file)
@@ -58,8 +58,18 @@ Ispy::write(lisp::Writer& writer)
   writer.start_list("ispy");
   writer.write_float("x", bbox.p1.x);
   writer.write_float("y", bbox.p1.y);
+  writer.write_string("script", script);
+  switch (dir)
+  {
+    case DOWN:
+      writer.write_string("direction", "down"); break;
+    case LEFT:
+      writer.write_string("direction", "left"); break;
+    case RIGHT:
+      writer.write_string("direction", "right"); break;
+    default: break;
+  }
   writer.end_list("ispy");
-  // TODO: does not really write out Ispy
 }
 
 HitResponse
@@ -133,10 +143,10 @@ Ispy::free_line_of_sight(Vector line_start, Vector line_end, const MovingObject*
     for (float test_y = lsy; test_y <= ley; test_y += 16) {
       for(std::list<TileMap*>::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) {
         TileMap* solids = *i;
-       const Tile* tile = solids->get_tile_at(Vector(test_x, test_y));
-       if(!tile) continue;
+        const Tile* tile = solids->get_tile_at(Vector(test_x, test_y));
+        if(!tile) continue;
         // FIXME: check collision with slope tiles
-       if((tile->getAttributes() & Tile::SOLID)) return false;
+        if((tile->getAttributes() & Tile::SOLID)) return false;
       }
     }
   }