diff --git a/common/main/fuelcen.h b/common/main/fuelcen.h index 5a11ab230..cda124f92 100644 --- a/common/main/fuelcen.h +++ b/common/main/fuelcen.h @@ -62,7 +62,7 @@ void fuelcen_reset(); void fuelcen_create( vsegptridx_t segp); // Makes a fuel center active... needs to be called when // a segment is loaded from disk. -void fuelcen_activate( vsegptridx_t segp, int station_type ); +void fuelcen_activate(vsegptridx_t segp); // Deletes a segment as a fuel center. void fuelcen_delete(vsegptr_t segp); diff --git a/similar/editor/centers.cpp b/similar/editor/centers.cpp index aa0c11d71..7ffa43b00 100644 --- a/similar/editor/centers.cpp +++ b/similar/editor/centers.cpp @@ -206,7 +206,8 @@ window_event_result centers_dialog_handler(UI_DIALOG *dlg,const d_event &event, { fuelcen_delete(Cursegp); Update_flags |= UF_WORLD_CHANGED; - fuelcen_activate( Cursegp, i ); + Cursegp->special = i; + fuelcen_activate(Cursegp); } rval = window_event_result::handled; } diff --git a/similar/editor/group.cpp b/similar/editor/group.cpp index ef31d2cdf..219f0e991 100644 --- a/similar/editor/group.cpp +++ b/similar/editor/group.cpp @@ -1238,7 +1238,7 @@ static int med_load_group( const char *filename, group::vertex_array_type_t &ver *segp = tseg; segp->objects = object_none; - fuelcen_activate(segp, segp->special); + fuelcen_activate(segp); } range_for (const auto &gs, segment_ids) diff --git a/similar/editor/med.cpp b/similar/editor/med.cpp index 8573331c8..f7fd56286 100644 --- a/similar/editor/med.cpp +++ b/similar/editor/med.cpp @@ -438,7 +438,7 @@ int SetPlayerFromCurseg() int fuelcen_create_from_curseg() { Cursegp->special = SEGMENT_IS_FUELCEN; - fuelcen_activate(Cursegp, Cursegp->special); + fuelcen_activate(Cursegp); return 1; } @@ -453,14 +453,14 @@ int repaircen_create_from_curseg() int controlcen_create_from_curseg() { Cursegp->special = SEGMENT_IS_CONTROLCEN; - fuelcen_activate(Cursegp, Cursegp->special); + fuelcen_activate(Cursegp); return 1; } int robotmaker_create_from_curseg() { Cursegp->special = SEGMENT_IS_ROBOTMAKER; - fuelcen_activate(Cursegp, Cursegp->special); + fuelcen_activate(Cursegp); return 1; } diff --git a/similar/main/fuelcen.cpp b/similar/main/fuelcen.cpp index bef07b3a9..145a9dd25 100644 --- a/similar/main/fuelcen.cpp +++ b/similar/main/fuelcen.cpp @@ -188,15 +188,12 @@ static void matcen_create(const vsegptridx_t segp) //------------------------------------------------------------ // Adds a segment that already is a special type into the Station array. -void fuelcen_activate(const vsegptridx_t segp, int station_type ) +void fuelcen_activate(const vsegptridx_t segp) { - segp->special = station_type; - if (segp->special == SEGMENT_IS_ROBOTMAKER) matcen_create( segp); else fuelcen_create( segp); - } // The lower this number is, the more quickly the center can be re-triggered. diff --git a/similar/main/gamemine.cpp b/similar/main/gamemine.cpp index 469fce310..405c72e15 100644 --- a/similar/main/gamemine.cpp +++ b/similar/main/gamemine.cpp @@ -668,7 +668,7 @@ int load_mine_data(PHYSFS_File *LoadFile) i->matcen_num = v16_seg.matcen_num; i->static_light = v16_seg.static_light; #endif - fuelcen_activate(i, i->special); + fuelcen_activate(i); } else Error("Invalid mine version"); @@ -709,7 +709,7 @@ int load_mine_data(PHYSFS_File *LoadFile) range_for (const auto &&segp, vsegptridx) { segment2_read(segp, LoadFile); - fuelcen_activate(segp, segp->special); + fuelcen_activate(segp); } #endif } @@ -1020,7 +1020,7 @@ int load_mine_data_compiled(PHYSFS_File *LoadFile) const auto &&pi = vsegptridx(&i); if (Gamesave_current_version > 5) segment2_read(pi, LoadFile); - fuelcen_activate(pi, i.special ); + fuelcen_activate(pi); } reset_objects(1); //one object, the player