mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2023-12-30 21:52:56 +00:00
57af3af800
* fix harmless warnings and properly try/catch allocations via new otherwise the error handling will never be triggered * increase precision of mode_countdown_ handling potentially there could be modes running a bit too long, depending on passed in ms (which were implicitly truncated before when passing in) also fix some harmless warnings * document warnings that i cannot handle on my own * revert changes to have a new cleaner PR after review/cherry picks * increase precision of mode_countdown_ handling potentially there could be modes running a bit too long, depending on passed in ms (which were implicitly truncated before when passing in) also fix some harmless warnings and add comments where original code is 'correct' but weird
26 lines
619 B
C++
26 lines
619 B
C++
#include "pch.h"
|
|
#include "TTripwire.h"
|
|
|
|
#include "control.h"
|
|
#include "loader.h"
|
|
#include "TBall.h"
|
|
#include "TPinballTable.h"
|
|
|
|
TTripwire::TTripwire(TPinballTable* table, int groupIndex) : TRollover(table, groupIndex, true)
|
|
{
|
|
}
|
|
|
|
void TTripwire::Collision(TBall* ball, vector_type* nextPosition, vector_type* direction, float coef,
|
|
TEdgeSegment* edge)
|
|
{
|
|
ball->Position.X = nextPosition->X;
|
|
ball->Position.Y = nextPosition->Y;
|
|
ball->RayMaxDistance -= coef;
|
|
ball->not_again(edge);
|
|
if (!PinballTable->TiltLockFlag)
|
|
{
|
|
loader::play_sound(SoftHitSoundId);
|
|
control::handler(63, this);
|
|
}
|
|
}
|