Fix translation error in CScriptGenerator

This commit is contained in:
Phillip Stephens 2017-01-24 09:47:11 -08:00
parent 696f7a9772
commit f57b44a786
2 changed files with 21 additions and 20 deletions

View File

@ -6,13 +6,13 @@
namespace urde
{
CScriptGenerator::CScriptGenerator(TUniqueId uid, const std::string& name, const CEntityInfo& info, u32 w1, bool b1,
const zeus::CVector3f& vec1, bool follow, bool active, float minScale,
float maxScale)
CScriptGenerator::CScriptGenerator(TUniqueId uid, const std::string& name, const CEntityInfo& info, u32 spawnCount,
bool reuseFollowers, const zeus::CVector3f& vec1, bool inheritXf, bool active,
float minScale, float maxScale)
: CEntity(uid, info, active, name)
, x34_spawnCount(w1)
, x38_24_reuseFollowers(b1)
, x38_25_inheritTransform(follow)
, x34_spawnCount(spawnCount)
, x38_24_reuseFollowers(reuseFollowers)
, x38_25_inheritTransform(inheritXf)
, x3c_offset(vec1)
, x48_minScale(minScale)
, x4c_maxScale(maxScale)
@ -99,7 +99,7 @@ void CScriptGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId
{
if (x38_25_inheritTransform)
activateActor->SetTransform(followActor->GetTransform());
activateActor->SetTranslation(activateActor->GetTranslation() + x3c_offset);
activateActor->SetTranslation(followActor->GetTranslation() + x3c_offset);
}
else if (follow != nullptr)
{
@ -115,7 +115,7 @@ void CScriptGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId
{
if (x38_25_inheritTransform)
activateActor->SetTransform(followActor->GetTransform());
activateActor->SetTranslation(activateActor->GetTranslation() + x3c_offset);
activateActor->SetTranslation(followActor->GetTranslation() + x3c_offset);
}
float rnd = stateMgr.GetActiveRandom()->Range(x48_minScale, x4c_maxScale);

View File

@ -700,17 +700,18 @@ CEntity* ScriptLoader::LoadGenerator(CStateManager& mgr, CInputStream& in, int p
std::string name = mgr.HashInstanceName(in);
u32 w1 = in.readUint32Big();
bool b1 = in.readBool();
bool b2 = in.readBool();
u32 spawnCount = in.readUint32Big();
bool reuseFollowers = in.readBool();
bool inheritXf = in.readBool();
zeus::CVector3f v1 = zeus::CVector3f::ReadBig(in);
zeus::CVector3f offset = zeus::CVector3f::ReadBig(in);
bool b3 = in.readBool();
float f1 = in.readFloatBig();
float f2 = in.readFloatBig();
bool active = in.readBool();
float minScale = in.readFloatBig();
float maxScale = in.readFloatBig();
return new CScriptGenerator(mgr.AllocateUniqueId(), name, info, w1, b1, v1, b2, b3, f1, f2);
return new CScriptGenerator(mgr.AllocateUniqueId(), name, info, spawnCount, reuseFollowers, offset, inheritXf,
active, minScale, maxScale);
}
CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
@ -1782,10 +1783,10 @@ CEntity* ScriptLoader::LoadWallCrawlerSwarm(CStateManager& mgr, CInputStream& in
u32 w14 = in.readUint32Big();
u32 w15 = in.readUint32Big();
return new CWallCrawlerSwarm(mgr.AllocateUniqueId(), active, aHead.x0_name, info,
aHead.x40_scale, aHead.x10_transform, w1, CAnimRes(w2, w3, {1.5f}, w4, true), w5, w6,
w7, w8, w9, w10, dInfo1, dInfo2, f1, f2, f3, f4, w11, w12, f5, f6, f7, f8, f9, f10,
f11, f12, f13, w13, f14, f15, f16, hInfo, dVulns, w14, w15, aParams);
return new CWallCrawlerSwarm(mgr.AllocateUniqueId(), active, aHead.x0_name, info, aHead.x40_scale,
aHead.x10_transform, w1, CAnimRes(w2, w3, {1.5f}, w4, true), w5, w6, w7, w8, w9, w10,
dInfo1, dInfo2, f1, f2, f3, f4, w11, w12, f5, f6, f7, f8, f9, f10, f11, f12, f13, w13,
f14, f15, f16, hInfo, dVulns, w14, w15, aParams);
}
CEntity* ScriptLoader::LoadAiJumpPoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)