@@ -324,12 +324,8 @@ static bool MovePlane(PlaneMover *plane)
324
324
325
325
Sector *sec = plane->sector ;
326
326
327
- if (sec->old_game_tic != game_tic)
328
- {
329
- plane->sector ->old_ceiling_height = plane->sector ->ceiling_height ;
330
- plane->sector ->old_floor_height = plane->sector ->floor_height ;
331
- plane->sector ->old_game_tic = game_tic;
332
- }
327
+ sec->old_ceiling_height = sec->ceiling_height ;
328
+ sec->old_floor_height = sec->floor_height ;
333
329
334
330
switch (plane->direction )
335
331
{
@@ -338,29 +334,29 @@ static bool MovePlane(PlaneMover *plane)
338
334
break ;
339
335
340
336
case kPlaneDirectionDown :
341
- res = AttemptMoveSector (plane-> sector , plane, HMM_MIN (plane->start_height , plane->destination_height ),
337
+ res = AttemptMoveSector (sec , plane, HMM_MIN (plane->start_height , plane->destination_height ),
342
338
plane->is_ceiling ? plane->crush : 0 );
343
339
344
340
if (!AlmostEquals (plane->destination_height , plane->start_height ))
345
341
{
346
- MakeMovingSound (&plane->sound_effect_started , plane->type ->sfxdown_ , &plane-> sector ->sound_effects_origin );
342
+ MakeMovingSound (&plane->sound_effect_started , plane->type ->sfxdown_ , &sec ->sound_effects_origin );
347
343
}
348
344
349
345
if (res == RES_PastDest)
350
346
{
351
347
if (!AlmostEquals (plane->destination_height , plane->start_height ))
352
348
{
353
- StartSoundEffect (plane->type ->sfxstop_ , kCategoryLevel , &plane-> sector ->sound_effects_origin );
349
+ StartSoundEffect (plane->type ->sfxstop_ , kCategoryLevel , &sec ->sound_effects_origin );
354
350
}
355
351
356
352
plane->speed = plane->type ->speed_up_ ;
357
353
358
354
if (plane->new_special != -1 )
359
355
{
360
- SectorChangeSpecial (plane-> sector , plane->new_special );
356
+ SectorChangeSpecial (sec , plane->new_special );
361
357
}
362
358
363
- SECPIC (plane-> sector , plane->is_ceiling , plane->new_image );
359
+ SECPIC (sec , plane->is_ceiling , plane->new_image );
364
360
365
361
switch (plane->type ->type_ )
366
362
{
@@ -372,7 +368,7 @@ static bool MovePlane(PlaneMover *plane)
372
368
break ;
373
369
374
370
case kPlaneMoverMoveWaitReturn :
375
- if (AlmostEquals (HEIGHT (plane-> sector , plane->is_ceiling ), plane->start_height ))
371
+ if (AlmostEquals (HEIGHT (sec , plane->is_ceiling ), plane->start_height ))
376
372
{
377
373
return true ; // REMOVE ME
378
374
}
@@ -420,12 +416,12 @@ static bool MovePlane(PlaneMover *plane)
420
416
int dir;
421
417
float dest;
422
418
423
- if (AlmostEquals (HEIGHT (plane-> sector , plane->is_ceiling ), plane->destination_height ))
419
+ if (AlmostEquals (HEIGHT (sec , plane->is_ceiling ), plane->destination_height ))
424
420
dest = plane->start_height ;
425
421
else
426
422
dest = plane->destination_height ;
427
423
428
- if (HEIGHT (plane-> sector , plane->is_ceiling ) > dest)
424
+ if (HEIGHT (sec , plane->is_ceiling ) > dest)
429
425
{
430
426
dir = kPlaneDirectionDown ;
431
427
plane->speed = plane->type ->speed_down_ ;
@@ -438,7 +434,7 @@ static bool MovePlane(PlaneMover *plane)
438
434
439
435
if (dir)
440
436
{
441
- StartSoundEffect (plane->type ->sfxstart_ , kCategoryLevel , &plane-> sector ->sound_effects_origin );
437
+ StartSoundEffect (plane->type ->sfxstart_ , kCategoryLevel , &sec ->sound_effects_origin );
442
438
}
443
439
444
440
plane->direction = dir; // time to go back
@@ -447,27 +443,27 @@ static bool MovePlane(PlaneMover *plane)
447
443
break ;
448
444
449
445
case kPlaneDirectionUp :
450
- res = AttemptMoveSector (plane-> sector , plane, HMM_MAX (plane->start_height , plane->destination_height ),
446
+ res = AttemptMoveSector (sec , plane, HMM_MAX (plane->start_height , plane->destination_height ),
451
447
plane->is_ceiling ? 0 : plane->crush );
452
448
453
449
if (!AlmostEquals (plane->destination_height , plane->start_height ))
454
450
{
455
- MakeMovingSound (&plane->sound_effect_started , plane->type ->sfxup_ , &plane-> sector ->sound_effects_origin );
451
+ MakeMovingSound (&plane->sound_effect_started , plane->type ->sfxup_ , &sec ->sound_effects_origin );
456
452
}
457
453
458
454
if (res == RES_PastDest)
459
455
{
460
456
if (!AlmostEquals (plane->destination_height , plane->start_height ))
461
457
{
462
- StartSoundEffect (plane->type ->sfxstop_ , kCategoryLevel , &plane-> sector ->sound_effects_origin );
458
+ StartSoundEffect (plane->type ->sfxstop_ , kCategoryLevel , &sec ->sound_effects_origin );
463
459
}
464
460
465
461
if (plane->new_special != -1 )
466
462
{
467
- SectorChangeSpecial (plane-> sector , plane->new_special );
463
+ SectorChangeSpecial (sec , plane->new_special );
468
464
}
469
465
470
- SECPIC (plane-> sector , plane->is_ceiling , plane->new_image );
466
+ SECPIC (sec , plane->is_ceiling , plane->new_image );
471
467
472
468
switch (plane->type ->type_ )
473
469
{
@@ -479,7 +475,7 @@ static bool MovePlane(PlaneMover *plane)
479
475
break ;
480
476
481
477
case kPlaneMoverMoveWaitReturn :
482
- if (AlmostEquals (HEIGHT (plane-> sector , plane->is_ceiling ), plane->start_height ))
478
+ if (AlmostEquals (HEIGHT (sec , plane->is_ceiling ), plane->start_height ))
483
479
{
484
480
return true ; // REMOVE ME
485
481
}
0 commit comments