Various bug fixes

This commit is contained in:
Jack Andersen 2018-10-26 20:16:12 -10:00
parent 29dad50cca
commit 427f5d8786
10 changed files with 28 additions and 19 deletions

View File

@ -254,8 +254,8 @@ void CSortedListManager::BuildNearList(rstl::reserved_vector<TUniqueId, 1024>& o
mag = 8000.f;
zeus::CVector3f ray = dir * mag;
zeus::CVector3f sum = ray + pos;
zeus::CVector3f maxs(std::max(pos.z, sum.z), std::max(pos.y, sum.y), std::max(pos.x, sum.x));
zeus::CVector3f mins(std::min(sum.z, pos.z), std::min(sum.y, pos.y), std::min(sum.y, pos.y));
zeus::CVector3f maxs(std::max(pos.x, sum.x), std::max(pos.y, sum.y), std::max(pos.z, sum.z));
zeus::CVector3f mins(std::min(sum.x, pos.x), std::min(sum.y, pos.y), std::min(sum.z, pos.z));
BuildNearList(out, zeus::CAABox(mins, maxs), filter, actor);
}

View File

@ -363,10 +363,10 @@ void CHudDecoInterfaceScan::Update(float dt, const CStateManager& stateMgr)
if (oldSidesPositioner != x234_sidesPositioner)
{
zeus::CVector3f sidesPos(x234_sidesPositioner, 0.f, 0.f);
x24c_basewidget_leftside->SetLocalPosition(x24c_basewidget_leftside->RotateO2P(
x218_leftsidePosition + sidesPos));
x250_basewidget_rightside->SetLocalPosition(x250_basewidget_rightside->RotateO2P(
x224_rightsidePosition - sidesPos));
x24c_basewidget_leftside->SetLocalPosition(x218_leftsidePosition +
x24c_basewidget_leftside->RotateO2P(sidesPos));
x250_basewidget_rightside->SetLocalPosition(x224_rightsidePosition -
x250_basewidget_rightside->RotateO2P(sidesPos));
}
x244_camera->SetO2WTransform(

View File

@ -100,6 +100,7 @@ void CScanDisplay::ProcessInput(const CFinalInput& input)
else
{
xc_state = EScanState::ViewingScan;
x1a4_xAlpha = 1.f;
CSfxManager::SfxStart(SFXui_scan_next_page, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
}
}

View File

@ -387,6 +387,7 @@ void CActor::SetVolume(float vol)
{
if (x8c_loopingSfxHandle)
CSfxManager::UpdateEmitter(x8c_loopingSfxHandle, GetTranslation(), zeus::CVector3f::skZero, vol);
xd4_maxVol = vol;
}
const zeus::CTransform CActor::GetScaledLocatorTransform(std::string_view segName) const

View File

@ -4662,7 +4662,7 @@ void CPlayer::UpdateOrbitableObjects(CStateManager& mgr)
{
x354_onScreenOrbitObjects.clear();
x344_nearbyOrbitObjects.clear();
x354_onScreenOrbitObjects.clear();
x364_offScreenOrbitObjects.clear();
if (CheckOrbitDisableSourceList(mgr))
return;
@ -4801,6 +4801,7 @@ TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>& ids,
minEyeToOrbitMag = eyeToOrbitMag;
minPosInBoxMagSq = posInBoxLeft * posInBoxLeft + posInBoxTop * posInBoxTop;
}
continue;
}
if (std::fabs(eyeToOrbitMag - minEyeToOrbitMag) <

View File

@ -43,12 +43,19 @@ void CScriptDock::Think(float dt, CStateManager& mgr)
x268_24_dockReferenced = false;
}
if (x268_26_areaPostConstructed != mgr.WorldNC()->GetArea(x260_area)->IsPostConstructed())
const IGameArea::Dock* gameDock = mgr.WorldNC()->GetArea(x260_area)->GetDock(x25c_dock);
TAreaId connArea = gameDock->GetConnectedAreaId(gameDock->GetReferenceCount());
if (connArea != kInvalidAreaId)
{
if (mgr.WorldNC()->GetArea(x260_area)->IsPostConstructed())
CEntity::SendScriptMsgs(EScriptObjectState::MaxReached, mgr, EScriptObjectMessage::None);
else
CEntity::SendScriptMsgs(EScriptObjectState::Zero, mgr, EScriptObjectMessage::None);
bool connPostConstructed = mgr.WorldNC()->GetArea(connArea)->IsPostConstructed();
if (x268_26_areaPostConstructed != connPostConstructed)
{
x268_26_areaPostConstructed = connPostConstructed;
if (connPostConstructed)
CEntity::SendScriptMsgs(EScriptObjectState::MaxReached, mgr, EScriptObjectMessage::None);
else
CEntity::SendScriptMsgs(EScriptObjectState::Zero, mgr, EScriptObjectMessage::None);
}
}
if (mgr.GetNextAreaId() != x260_area)
@ -69,8 +76,7 @@ void CScriptDock::Think(float dt, CStateManager& mgr)
mgr.SetCurrentAreaId(aid);
s32 otherDock = dock->GetOtherDockNumber(dock->GetReferenceCount());
CObjectList* objs = mgr.WorldNC()->GetArea(aid)->GetAreaObjects();
if (objs)
if (CObjectList* objs = mgr.WorldNC()->GetArea(aid)->GetAreaObjects())
{
for (CEntity* ent : *objs)
{

View File

@ -217,7 +217,7 @@ void CScriptDoor::Think(float dt, CStateManager& mgr)
}
if (x64_modelData->IsAnimating())
UpdateAnimation((x64_modelData->GetAnimationDuration(s32(x260_doorState)) / x258_animLen) * dt, mgr, true);
UpdateAnimation((x64_modelData->GetAnimationDuration(s32(x260_doorAnimState)) / x258_animLen) * dt, mgr, true);
xe7_31_targetable = mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan;
}
@ -400,7 +400,7 @@ u32 CScriptDoor::GetDoorOpenCondition(CStateManager& mgr)
/* ORIGINAL 0-00 OFFSET: 8007E9D0 */
void CScriptDoor::SetDoorAnimation(CScriptDoor::EDoorAnimType type)
{
x260_doorState = type;
x260_doorAnimState = type;
CModelData* modelData = x64_modelData.get();
if (modelData && modelData->AnimationData())
modelData->AnimationData()->SetAnimation(CAnimPlaybackParms(s32(type), -1, 1.f, true), false);

View File

@ -17,7 +17,7 @@ public:
float x258_animLen;
float x25c_animTime = 0.f;
EDoorAnimType x260_doorState = EDoorAnimType::Open;
EDoorAnimType x260_doorAnimState = EDoorAnimType::Open;
zeus::CAABox x264_;
TUniqueId x27c_partner1 = kInvalidUniqueId;
TUniqueId x27e_partner2 = kInvalidUniqueId;

View File

@ -26,7 +26,7 @@ IGameArea::Dock::Dock(urde::CInputStream& in, const zeus::CTransform& xf)
TAreaId IGameArea::Dock::GetConnectedAreaId(s32 other) const
{
if (u32(other) >= x4_dockReferences.size() || other < 0)
if (x4_dockReferences.empty())
return kInvalidAreaId;
return x4_dockReferences[other].x0_area;

2
amuse

@ -1 +1 @@
Subproject commit 885a2d2154a9ddc00b878b9707d8ad01817ea4e7
Subproject commit b4c073c373b4a67dfe9cee4f52469565b8f8f4f6