2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 21:11:21 +00:00
metaforce/Runtime/World/CScriptRipple.cpp
Lioncash 221cc5c6b8 RuntimeCommonB: Normalize cpp file includes
Like the prior changes normalizing the inclusions within headers, this
tackles the cpp files of the RuntimeCommonB target, making these source
files consistent with their headers.
2019-12-22 18:12:04 -05:00

37 lines
1.3 KiB
C++

#include "Runtime/World/CScriptRipple.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/World/CScriptWater.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
namespace urde {
CScriptRipple::CScriptRipple(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f& vec,
bool active, float f1)
: CEntity(uid, info, active, name), x34_magnitude(f1 >= 0.f ? f1 : 0.5f), x38_center(vec) {}
void CScriptRipple::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptRipple::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
if (msg == EScriptObjectMessage::Play) {
if (!GetActive())
return;
for (const SConnection& conn : x20_conns) {
if (conn.x0_state != EScriptObjectState::Active || conn.x4_msg != EScriptObjectMessage::Next)
continue;
auto search = mgr.GetIdListForScript(conn.x8_objId);
for (auto it = search.first; it != search.second; ++it) {
if (TCastToPtr<CScriptWater> water = mgr.ObjectById(it->second))
water->GetFluidPlane().AddRipple(x34_magnitude, GetUniqueId(), x38_center, *water, mgr);
}
}
return;
}
CEntity::AcceptScriptMsg(msg, uid, mgr);
}
} // namespace urde