mirror of https://github.com/AxioDL/metaforce.git
CScriptEffect: Minor fixes
This commit is contained in:
parent
1f55b5f92e
commit
416ca4653b
|
@ -76,6 +76,7 @@ CScriptEffect::CScriptEffect(TUniqueId uid, std::string_view name, const CEntity
|
||||||
xf4_electric->SetGlobalTranslation(xf.origin);
|
xf4_electric->SetGlobalTranslation(xf.origin);
|
||||||
xf4_electric->SetGlobalScale(scale);
|
xf4_electric->SetGlobalScale(scale);
|
||||||
xf4_electric->SetParticleEmission(active);
|
xf4_electric->SetParticleEmission(active);
|
||||||
|
xf4_electric->SetModulationColor(lParms.GetNoLightsAmbient());
|
||||||
}
|
}
|
||||||
xe7_29_drawEnabled = true;
|
xe7_29_drawEnabled = true;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +98,6 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt
|
||||||
x104_particleSystem->SetOrientation(newXf);
|
x104_particleSystem->SetOrientation(newXf);
|
||||||
x104_particleSystem->SetGlobalTranslation(GetTranslation());
|
x104_particleSystem->SetGlobalTranslation(GetTranslation());
|
||||||
x104_particleSystem->SetGlobalScale(scale);
|
x104_particleSystem->SetGlobalScale(scale);
|
||||||
x104_particleSystem->SetParticleEmission(oldActive);
|
|
||||||
x104_particleSystem->SetModulationColor(color);
|
x104_particleSystem->SetModulationColor(color);
|
||||||
x104_particleSystem->SetModelsUseLights(x138_actorLights != nullptr);
|
x104_particleSystem->SetModelsUseLights(x138_actorLights != nullptr);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,6 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt
|
||||||
xf4_electric->SetOrientation(newXf);
|
xf4_electric->SetOrientation(newXf);
|
||||||
xf4_electric->SetGlobalTranslation(GetTranslation());
|
xf4_electric->SetGlobalTranslation(GetTranslation());
|
||||||
xf4_electric->SetGlobalScale(scale);
|
xf4_electric->SetGlobalScale(scale);
|
||||||
xf4_electric->SetParticleEmission(oldActive);
|
|
||||||
xf4_electric->SetModulationColor(color);
|
xf4_electric->SetModulationColor(color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,26 +151,28 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt
|
||||||
mgr.SendScriptMsg(light, uid, msg);
|
mgr.SendScriptMsg(light, uid, msg);
|
||||||
|
|
||||||
if (oldActive != GetActive()) {
|
if (oldActive != GetActive()) {
|
||||||
std::vector<TUniqueId> playIds;
|
if (GetActive()) {
|
||||||
for (const SConnection& conn : x20_conns) {
|
std::vector<TUniqueId> playIds;
|
||||||
if (conn.x0_state != EScriptObjectState::Play || conn.x4_msg != EScriptObjectMessage::Activate)
|
for (const SConnection& conn : x20_conns) {
|
||||||
continue;
|
if (conn.x0_state != EScriptObjectState::Play || conn.x4_msg != EScriptObjectMessage::Activate)
|
||||||
|
continue;
|
||||||
|
|
||||||
TUniqueId uid = mgr.GetIdForScript(conn.x8_objId);
|
TUniqueId connId = mgr.GetIdForScript(conn.x8_objId);
|
||||||
if (uid != kInvalidUniqueId)
|
if (connId != kInvalidUniqueId)
|
||||||
playIds.push_back(uid);
|
playIds.push_back(connId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playIds.size() > 0) {
|
if (!playIds.empty()) {
|
||||||
TCastToConstPtr<CActor> otherAct =
|
TCastToConstPtr<CActor> otherAct =
|
||||||
mgr.GetObjectById(playIds[u32(0.99f * playIds.size() * mgr.GetActiveRandom()->Float())]);
|
mgr.GetObjectById(playIds[u32(0.99f * playIds.size() * mgr.GetActiveRandom()->Float())]);
|
||||||
if (otherAct) {
|
if (otherAct) {
|
||||||
if (light)
|
|
||||||
light->SetTransform(otherAct->GetTransform());
|
|
||||||
else
|
|
||||||
SetTransform(otherAct->GetTransform());
|
SetTransform(otherAct->GetTransform());
|
||||||
|
if (light)
|
||||||
|
light->SetTransform(otherAct->GetTransform());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x110_24_enable = true;
|
x110_24_enable = true;
|
||||||
if (x104_particleSystem)
|
if (x104_particleSystem)
|
||||||
x104_particleSystem->SetParticleEmission(GetActive());
|
x104_particleSystem->SetParticleEmission(GetActive());
|
||||||
|
|
Loading…
Reference in New Issue