Pass only valptr_t to fuelcen_delete
This commit is contained in:
parent
1248f9a474
commit
aa890e5d29
|
@ -63,7 +63,7 @@ void fuelcen_create( vsegptridx_t segp);
|
||||||
// a segment is loaded from disk.
|
// a segment is loaded from disk.
|
||||||
void fuelcen_activate( vsegptridx_t segp, int station_type );
|
void fuelcen_activate( vsegptridx_t segp, int station_type );
|
||||||
// Deletes a segment as a fuel center.
|
// Deletes a segment as a fuel center.
|
||||||
void fuelcen_delete( vsegptridx_t segp );
|
void fuelcen_delete(vsegptr_t segp);
|
||||||
|
|
||||||
// Charges all fuel centers to max capacity.
|
// Charges all fuel centers to max capacity.
|
||||||
void fuelcen_replentish_all();
|
void fuelcen_replentish_all();
|
||||||
|
|
|
@ -248,14 +248,15 @@ void trigger_matcen(const vsegptridx_t segnum)
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// Takes away a segment's fuel center properties.
|
// Takes away a segment's fuel center properties.
|
||||||
// Deletes the segment point entry in the FuelCenter list.
|
// Deletes the segment point entry in the FuelCenter list.
|
||||||
void fuelcen_delete( const vsegptridx_t segp )
|
void fuelcen_delete(const vsegptr_t segp)
|
||||||
{
|
{
|
||||||
Restart: ;
|
Restart: ;
|
||||||
segp->special = 0;
|
segp->special = 0;
|
||||||
|
|
||||||
for (uint_fast32_t i = 0; i < Num_fuelcenters; i++ ) {
|
for (uint_fast32_t i = 0; i < Num_fuelcenters; i++ ) {
|
||||||
FuelCenter &fi = Station[i];
|
FuelCenter &fi = Station[i];
|
||||||
if (fi.segnum == segp) {
|
if (vsegptr(fi.segnum) == segp)
|
||||||
|
{
|
||||||
|
|
||||||
// If Robot maker is deleted, fix Segments and RobotCenters.
|
// If Robot maker is deleted, fix Segments and RobotCenters.
|
||||||
if (fi.Type == SEGMENT_IS_ROBOTMAKER) {
|
if (fi.Type == SEGMENT_IS_ROBOTMAKER) {
|
||||||
|
|
Loading…
Reference in a new issue