- floatified handle_se25

This commit is contained in:
Christoph Oelckers 2022-09-12 23:35:48 +02:00
parent 5eb9af1e00
commit 4196195b89
5 changed files with 12 additions and 17 deletions

View file

@ -4392,18 +4392,19 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
//
//---------------------------------------------------------------------------
void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2)
void handle_se25(DDukeActor* actor, int snd1, int snd2)
{
auto sec = actor->sector();
auto add = actor->spr.yint * zmaptoworld;
if (sec->floorz <= sec->ceilingz)
actor->spr.shade = 0;
else if (sec->int_ceilingz() <= actor->temp_data[t_index])
else if (sec->ceilingz <= actor->temp_pos.Z)
actor->spr.shade = 1;
if (actor->spr.shade)
{
sec->addceilingz(actor->spr.yint * zmaptoworld);
sec->addceilingz(add);
if (sec->ceilingz > sec->floorz)
{
sec->setceilingz(sec->floorz);
@ -4413,10 +4414,10 @@ void handle_se25(DDukeActor* actor, int t_index, int snd1, int snd2)
}
else
{
sec->addceilingz(-actor->spr.yint * zmaptoworld);
if (sec->int_ceilingz() < actor->temp_data[t_index])
sec->addceilingz(-add);
if (sec->ceilingz < actor->temp_pos.Z)
{
sec->set_int_ceilingz(actor->temp_data[t_index]);
sec->setceilingz(actor->temp_pos.Z);
if (pistonsound && snd2 >= 0)
S_PlayActorSound(snd2, actor);
}

View file

@ -3406,7 +3406,7 @@ void moveeffectors_d(void) //STATNUM 3
case SE_25_PISTON: //PISTONS
if (act->temp_data[4] == 0) break;
handle_se25(act, 3, -1, -1);
handle_se25(act, -1, -1);
break;
case SE_26:

View file

@ -3368,7 +3368,7 @@ void moveeffectors_r(void) //STATNUM 3
case SE_25_PISTON: //PISTONS
if (act->temp_data[4] == 0) break;
handle_se25(act, 4, isRRRA() ? 371 : -1, isRRRA() ? 167 : -1);
handle_se25(act, isRRRA() ? 371 : -1, isRRRA() ? 167 : -1);
break;
case SE_26:

View file

@ -86,7 +86,7 @@ void handle_se20(DDukeActor* i);
void handle_se21(DDukeActor* i);
void handle_se22(DDukeActor* i);
void handle_se24(DDukeActor* actor, bool scroll, int shift);
void handle_se25(DDukeActor* a, int t_index, int snd1, int snd2);
void handle_se25(DDukeActor* a, int snd1, int snd2);
void handle_se26(DDukeActor* i);
void handle_se27(DDukeActor* i);
void handle_se29(DDukeActor* actor);

View file

@ -661,14 +661,8 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->SetOwner(nullptr);
break;
case SE_25_PISTON: // Pistons
if (!isRR())
{
actor->temp_data[3] = sectp->int_ceilingz();
actor->temp_pos.Z = sectp->ceilingz;
actor->temp_data[4] = 1;
}
else
actor->temp_data[4] = sectp->int_ceilingz();
sectp->setceilingz(actor->spr.pos.Z);
StartInterpolation(sectp, Interp_Sect_Ceilingz);
break;