-
Notifications
You must be signed in to change notification settings - Fork 20
Pvs studio fixes #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Pvs studio fixes #186
Changes from 5 commits
4fe5418
4c7fddc
2ac4115
d2b0331
a348d46
0a7b5c8
2183da0
c999e67
dcd225b
15264ab
493de37
caaed0a
f685803
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,12 +126,6 @@ void MOSParticle::Travel() { | |
m_Atom->ClearMOIDIgnoreList(); | ||
|
||
if (m_SpriteAnimMode == ONCOLLIDE) { | ||
// Change angular velocity after collision. | ||
if (hitCount >= 1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also makes hitCount unused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should actually return hitcount from Atom travel instead? |
||
m_AngularVel *= 0.5F * velMag * RandomNormalNum(); | ||
m_AngularVel = -m_AngularVel; | ||
} | ||
|
||
// TODO: Rework this so it's less incomprehensible black magic math and not driven by AngularVel. | ||
double newFrame = m_Rotation.GetRadAngle(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,8 +269,6 @@ bool MOSprite::HitTestAtPixel(int pixelX, int pixelY, bool validOnly) const { | |
} | ||
|
||
void MOSprite::SetFrame(unsigned int newFrame) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty sure this is lua accessible so I'd rather this accept |
||
if (newFrame < 0) | ||
newFrame = 0; | ||
if (newFrame >= m_FrameCount) | ||
newFrame = m_FrameCount - 1; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure this borks delivery in some cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, those
break
s seem to be actually intentional. it's what we like to call Dan ™️ code (overly verbose code from the initial oss release that works mostly by luck)