Minor flamethrower and babygoth fixes

This commit is contained in:
Jack Andersen 2019-06-30 20:14:42 -10:00
parent 003146f614
commit fd0bfc3acf
5 changed files with 14 additions and 14 deletions

View File

@ -365,14 +365,13 @@ bool ViewManager::proc() {
}
void ViewManager::stop() {
m_videoVoice.reset();
m_mainWindow->getCommandQueue()->stopRenderer();
m_projManager.shutdown();
CDvdFile::Shutdown();
DestroyIcons();
DestroyBadging();
m_viewResources.destroyResData();
m_fontCache.destroyAtlases();
m_mainWindow->getCommandQueue()->stopRenderer();
}
} // namespace urde

View File

@ -120,7 +120,6 @@ class ViewManager final : public specter::IViewManager {
};
std::unique_ptr<TestGameView> m_testGameView;
std::unique_ptr<boo::IAudioVoiceEngine> m_voiceEngine;
std::unique_ptr<boo::IAudioVoice> m_videoVoice;
std::optional<amuse::BooBackendVoiceAllocator> m_amuseAllocWrapper;
hecl::SystemString m_recentProjectsPath;

View File

@ -5,20 +5,20 @@
namespace urde {
class CRandom16 {
u32 m_seed;
s32 m_seed;
static CRandom16* g_randomNumber;
public:
CRandom16(u32 p = 99) : m_seed(p) {}
CRandom16(s32 p = 99) : m_seed(p) {}
u32 Next() {
s32 Next() {
m_seed = (m_seed * 0x41c64e6d) + 0x00003039;
return m_seed >> 16;
return (m_seed >> 16) & 0xffff;
}
u32 GetSeed() const { return m_seed; }
s32 GetSeed() const { return m_seed; }
void SetSeed(u32 p) { m_seed = p; }
void SetSeed(s32 p) { m_seed = p; }
float Float() { return Next() * 0.000015259022f; }

View File

@ -146,6 +146,8 @@ void CBabygoth::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateM
case EScriptObjectMessage::InitializedInArea: {
x6ec_pathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
x7d0_approachPathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
if (x6e8_teamMgr == kInvalidUniqueId)
x6e8_teamMgr = CTeamAiMgr::GetTeamAiMgr(*this, mgr);
break;
}
case EScriptObjectMessage::Touched: {
@ -1075,7 +1077,7 @@ bool CBabygoth::Leash(CStateManager& mgr, float) {
}
bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
for (auto obj : mgr.GetListeningAiObjectList()) {
for (CEntity* obj : mgr.GetListeningAiObjectList()) {
if (TCastToPtr<CAi> ai = obj) {
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f)
@ -1128,9 +1130,9 @@ float CBabygoth::CalculateShellCrackHP(EShellState state) {
if (state == EShellState::Default)
return x570_babyData.GetShellHitPoints();
else if (state == EShellState::CrackOne)
return 0.66666669f * x570_babyData.GetShellHitPoints();
return (2.f / 3.f) * x570_babyData.GetShellHitPoints();
else if (state == EShellState::CrackTwo)
return 0.33333334f * x570_babyData.GetShellHitPoints();
return (1.f / 3.f) * x570_babyData.GetShellHitPoints();
return 0.f;
}
@ -1139,7 +1141,7 @@ bool CBabygoth::ShouldTurn(CStateManager& mgr, float arg) {
const float speedScale = GetModelData()->GetAnimationData()->GetSpeedScale();
zeus::CVector3f aimPos = mgr.GetPlayer().GetAimPosition(mgr, (speedScale > 0.f ? 1.f / speedScale : 0.f));
return zeus::CVector2f::getAngleDiff(GetTransform().basis[1].toVec2f(), (aimPos - GetTranslation()).toVec2f()) >
(arg == 0.f ? 0.78539819f : arg);
(arg == 0.f ? zeus::degToRad(45.f) : arg);
}
bool CBabygoth::ShouldAttack(CStateManager& mgr, float arg) {

View File

@ -44,7 +44,7 @@ void CFlameWarp::ModifyParticles(std::vector<CParticle>& particles) {
if (result.IsValid()) {
float dist = result.GetPlane().pointToPlaneDist(particle.x4_pos);
if (dist <= 0.f) {
particle.x4_pos = -result.GetPlane().normal() * dist;
particle.x4_pos -= result.GetPlane().normal() * dist;
if (result.GetPlane().normal().dot(particle.x1c_vel) < 0.f) {
zeus::CVector3f prevStepPos = particle.x4_pos - particle.x1c_vel;
particle.x4_pos +=