summaryrefslogtreecommitdiff
path: root/src/editor/editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor/editor.cpp')
-rw-r--r--src/editor/editor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/editor/editor.cpp b/src/editor/editor.cpp
index dee5080..e2267b8 100644
--- a/src/editor/editor.cpp
+++ b/src/editor/editor.cpp
@@ -604,8 +604,8 @@ STAT editor_new_map( GAME_EDITOR* e, const char* mapname ) {
WORLD_MAP* m = new WORLD_MAP;
defer( map_free( e->game, m ) );
- strcpy( m->name, mapname );
- strcat( m->name, ".hmap" );
+ m->name = mapname;
+ m->name += ".hmap";
m->startpos = { 10.f, 10.f, 0.f };
m->props.push( { .clr = { 1.f, 1.f, 1.f, 1.f } } );
@@ -641,11 +641,10 @@ STAT editor_save_map( GAME_EDITOR* e ) {
if( !serialized ) return STAT_ERR;
defer( cfg_free( serialized ) );
- char full_path[256];
- sprintf( full_path, "../assets/maps/%s", e->map->name );
+ STR full_path = { "../assets/maps/%s", e->map->name.data };
if( !OK( cfg_save( serialized, full_path ) ) ) {
- dlog( "failed to save map %s", full_path );
+ dlog( "failed to save map %s", full_path.data );
return STAT_ERR;
}