TPlunger: removed duplicated code.

Ref PR#52.
This commit is contained in:
Muzychenko Andrey 2021-10-18 10:52:13 +03:00
parent 348d79ef38
commit 685dfe78c2

View File

@ -54,28 +54,6 @@ int TPlunger::Message(int code, float value)
PullbackTimer(0, this); PullbackTimer(0, this);
} }
return 0; return 0;
case 1005:
case 1009:
case 1010:
{
Threshold = 0.0;
if (PullbackTimer_)
timer::kill(PullbackTimer_);
PullbackTimer_ = 0;
if (code == 1005)
loader::play_sound(SoundIndexP2);
auto bmp = ListBitmap->at(0);
auto zMap = ListZMap->at(0);
render::sprite_set(
RenderSprite,
bmp,
zMap,
bmp->XPosition - PinballTable->XOffset,
bmp->YPosition - PinballTable->YOffset);
timer::set(Unknown4F, this, PlungerReleasedTimer);
break;
}
case 1015: case 1015:
{ {
auto ball = PinballTable->BallList.at(0); auto ball = PinballTable->BallList.at(0);
@ -100,11 +78,18 @@ int TPlunger::Message(int code, float value)
Boost = static_cast<float>(MaxPullback); Boost = static_cast<float>(MaxPullback);
timer::set(0.2f, this, PlungerReleasedTimer); timer::set(0.2f, this, PlungerReleasedTimer);
break; break;
case 1005:
case 1009:
case 1010:
case 1024: case 1024:
{
if (code == 1024)
{ {
if (BallFeedTimer_) if (BallFeedTimer_)
timer::kill(BallFeedTimer_); timer::kill(BallFeedTimer_);
BallFeedTimer_ = 0; BallFeedTimer_ = 0;
}
Threshold = 0.0; Threshold = 0.0;
if (PullbackTimer_) if (PullbackTimer_)
timer::kill(PullbackTimer_); timer::kill(PullbackTimer_);