Skip to content

Commit 1dad973

Browse files
committed
Fix world saver treating lines as sprites (Secretchronicles#116).
Actually, there ARE a cSprite subclass, but with no image attached. They should probably be no sprites at all.
1 parent 15ad153 commit 1dad973

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

smc/src/overworld/overworld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ cOverworld_description :: ~cOverworld_description( void )
5858

5959
void cOverworld_description :: Save( void )
6060
{
61-
fs::path filename = pResource_Manager->Get_User_World_Directory() / m_path / utf8_to_path("description.xml");
61+
fs::path filename = pResource_Manager->Get_User_World_Directory() / m_path.filename() / utf8_to_path("description.xml");
6262

6363
try {
6464
Save_To_File(filename);

smc/src/overworld/world_layer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ cLayer_Line_Point :: ~cLayer_Line_Point( void )
7575
}
7676
}
7777

78+
xmlpp::Element* cLayer_Line_Point :: Save_To_XML_Node(xmlpp::Element* p_element)
79+
{
80+
// Do NOT call parent class’ method as we are no real sprite.
81+
// We are being saved into the world description file, so no
82+
// need to duplicate nonsensical entries in world.xml.
83+
return NULL;
84+
}
85+
7886
void cLayer_Line_Point :: Draw( cSurface_Request *request /* = NULL */ )
7987
{
8088
if( m_auto_destroy || !pOverworld_Manager->m_draw_layer )

smc/src/overworld/world_layer.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class cLayer_Line_Point : public cSprite
3636
// destructor
3737
virtual ~cLayer_Line_Point( void );
3838

39+
virtual xmlpp::Element* Save_To_XML_Node(xmlpp::Element* p_element);
40+
3941
// draw
4042
virtual void Draw( cSurface_Request *request = NULL );
4143

0 commit comments

Comments
 (0)