2017-02-03 23:32:15 +00:00
|
|
|
#include "MP1/World/CActorContraption.hpp"
|
2017-05-09 13:27:07 +00:00
|
|
|
#include "Weapon/CFlameThrower.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
|
|
|
#include "CSimplePool.hpp"
|
|
|
|
#include "CStateManager.hpp"
|
2017-05-07 06:55:01 +00:00
|
|
|
#include "TCastTo.hpp"
|
2017-02-03 23:32:15 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
MP1::CActorContraption::CActorContraption(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
|
|
|
const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabox,
|
|
|
|
const CMaterialList& matList, float f1, float f2, const CHealthInfo& hInfo,
|
|
|
|
const CDamageVulnerability& dVuln, const CActorParameters& aParams,
|
|
|
|
ResId part, const CDamageInfo& dInfo, bool active)
|
|
|
|
: CScriptActor(uid, name, info, xf, std::move(mData), aabox, f1, f2, matList, hInfo, dVuln, aParams, false, active, 0,
|
2017-05-09 13:27:07 +00:00
|
|
|
1.f, false, false, false, false)
|
|
|
|
, x300_flameThrowerGen(g_SimplePool->GetObj("FlameThrower"))
|
|
|
|
, x308_partId(part)
|
|
|
|
, x30c_dInfo(dInfo)
|
2017-02-03 23:32:15 +00:00
|
|
|
{
|
|
|
|
}
|
2017-05-07 06:55:01 +00:00
|
|
|
|
|
|
|
void MP1::CActorContraption::Accept(IVisitor& visitor)
|
|
|
|
{
|
|
|
|
visitor.Visit(this);
|
|
|
|
}
|
2017-05-09 13:27:07 +00:00
|
|
|
|
|
|
|
void MP1::CActorContraption::Think(float dt, CStateManager& mgr)
|
|
|
|
{
|
|
|
|
CScriptActor::Think(dt, mgr);
|
|
|
|
|
|
|
|
for (const std::pair<TUniqueId, std::string>& uid : x2ec_children)
|
|
|
|
{
|
|
|
|
CFlameThrower* act = static_cast<CFlameThrower*>(mgr.ObjectById(uid.first));
|
|
|
|
|
|
|
|
if (act && act->GetActive())
|
|
|
|
{
|
2017-05-10 00:03:20 +00:00
|
|
|
act->SetTransform(x34_transform * act->GetScaledLocatorTransform(uid.second));
|
2017-05-09 13:27:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-02-03 23:32:15 +00:00
|
|
|
}
|