From 374145633baf06051a4e4f7b2b1ea586f2ea32f3 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 12 Jul 2015 01:04:19 +0000 Subject: [PATCH] Use valptr for fuelcen.cpp --- similar/main/fuelcen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/similar/main/fuelcen.cpp b/similar/main/fuelcen.cpp index 53027e16b..4aec8e65c 100644 --- a/similar/main/fuelcen.cpp +++ b/similar/main/fuelcen.cpp @@ -373,7 +373,7 @@ static void robotmaker_proc( FuelCenter * robotcen ) return; } - segment *segp = &Segments[robotcen->segnum]; + const auto &&segp = vsegptr(robotcen->segnum); matcen_num = segp->matcen_num; if ( matcen_num == -1 ) { @@ -452,12 +452,12 @@ static void robotmaker_proc( FuelCenter * robotcen ) } } - const auto cur_object_loc = compute_segment_center(&Segments[robotcen->segnum]); + const auto &&cur_object_loc = compute_segment_center(vcsegptr(robotcen->segnum)); // HACK!!! The 10 under here should be something equal to the 1/2 the size of the segment. auto obj = object_create_explosion(robotcen->segnum, cur_object_loc, i2f(10), VCLIP_MORPHING_ROBOT ); if (obj != object_none) - extract_orient_from_segment(&obj->orient,&Segments[robotcen->segnum]); + extract_orient_from_segment(&obj->orient, vsegptr(robotcen->segnum)); if ( Vclip[VCLIP_MORPHING_ROBOT].sound_num > -1 ) { digi_link_sound_to_pos( Vclip[VCLIP_MORPHING_ROBOT].sound_num, robotcen->segnum, 0, cur_object_loc, 0, F1_0 ); @@ -474,7 +474,7 @@ static void robotmaker_proc( FuelCenter * robotcen ) robotcen->Flag = 0; robotcen->Timer = 0; - const auto cur_object_loc = compute_segment_center(&Segments[robotcen->segnum]); + const auto &&cur_object_loc = compute_segment_center(vcsegptr(robotcen->segnum)); // If this is the first materialization, set to valid robot. { @@ -501,7 +501,7 @@ static void robotmaker_proc( FuelCenter * robotcen ) else type = legal_types[(d_rand() * num_types) / 32768]; - const objptridx_t obj = create_morph_robot(&Segments[robotcen->segnum], cur_object_loc, type ); + const auto &&obj = create_morph_robot(vsegptridx(robotcen->segnum), cur_object_loc, type ); if (obj != object_none) { if (Game_mode & GM_MULTI) multi_send_create_robot(robotcen-Station, obj, type);