Batch #1827 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_18985 CEffect::RetireIfInactive: logic confirmed by peer review Reviewed-by: ragnarok-clanker
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#include "Contents/Effects/Effect.h"
|
|
|
|
#include "Contents/Effects/EffectLists.h"
|
|
|
|
// OFFSET: 0x00B4DAE0
|
|
// FUNCTION: fn_18979
|
|
CEffect::CEffect(int value)
|
|
: id(value), position{}, sourcePosition{}, actor(0), sourceActor(0), frame(0), unknown_002C(60), unknown_0030(1), outsideRange(0), range(130),
|
|
unknown_00B0(-1), retained(0), forceRender(0), unknown_00C4(0), unknown_00C8(0) {
|
|
}
|
|
|
|
// OFFSET: 0x00B4DD10
|
|
// OFFSET: 0x00B4DDD0
|
|
// FUNCTION: fn_18981
|
|
CEffect::~CEffect() = default;
|
|
|
|
// OFFSET: 0x005A2150
|
|
// FUNCTION: fn_03087
|
|
void CEffect::Close() {
|
|
}
|
|
|
|
// OFFSET: 0x00B4DE40
|
|
// FUNCTION: fn_18984
|
|
void CEffect::AddEvent(int kind, const char* text, int frame, int argument) {
|
|
EffectEvent event{kind, frame, argument, text ? text : ""};
|
|
this->events.push_back(event);
|
|
}
|
|
|
|
// OFFSET: 0x00B4DF90
|
|
// FUNCTION: fn_18985
|
|
bool CEffect::RetireIfInactive() {
|
|
if (!this->Slot06()) {
|
|
g_effectMgr->Retire(this, 0);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// OFFSET: 0x00B4E170
|
|
// FUNCTION: fn_18988
|
|
void CEffect::SetEventFrame(int kind, int frame) {
|
|
for (EffectEvent& event : this->events) {
|
|
if (event.kind == kind) {
|
|
event.frame = frame;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00B249A0
|
|
// FUNCTION: fn_18773
|
|
void EffectRetirement::Clear() {
|
|
for (auto effect = this->effects.begin(); effect != this->effects.end(); ++effect) {
|
|
(*effect)->Close();
|
|
delete *effect;
|
|
}
|
|
|
|
this->effects.clear();
|
|
}
|