Skip to content

Commit

Permalink
MagicFlare: Remove redundant member variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bsxf-47 committed Oct 5, 2023
1 parent c3c0c06 commit 096bfdf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/graphics/particle/MagicFlare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class MagicFlare {
public:
bool isValid;
char type = -1;
bool hasIO = false;
Vec3f pos3D = Vec3f(0.f);
Vec2f pos2D = Vec2f(0.f);
PlatformDuration tolive;
Expand Down Expand Up @@ -82,7 +81,6 @@ class MagicFlare {
MagicFlare::MagicFlare()
: isValid(false)
, type(-1)
, hasIO(false)
, pos3D(Vec3f(0.f))
, pos2D(Vec2f(0.f))
, size(0.f)
Expand All @@ -96,7 +94,7 @@ void MagicFlare::update(bool isMagicCastKeyPressed) {
PlatformDuration lastFrameDuration = g_platformTime.lastFrameDuration();

tolive -= lastFrameDuration * 2;
if(hasIO) {
if(io) {
tolive -= lastFrameDuration * 4;
} else if(!isMagicCastKeyPressed) {
tolive -= lastFrameDuration * 6;
Expand Down Expand Up @@ -140,7 +138,6 @@ void MagicFlare::clear() {
tolive = 0;
isValid = false;
io = nullptr;
hasIO = false;
type = -1;
m_currentShineTex = 1;
}
Expand Down Expand Up @@ -349,10 +346,7 @@ void MagicFlareHandler::addFlare(const Vec2f& pos, float sm, bool useVariedFlare

flare.io = io;
if(io) {
flare.hasIO = true;
io->flarecount++;
} else {
flare.hasIO = false;
}

flare.init2DPos(pos);
Expand Down

0 comments on commit 096bfdf

Please sign in to comment.