Fix disappearing actor issue

This commit is contained in:
Jack Andersen 2018-03-04 13:23:21 -10:00
parent 055de86170
commit 017185109f
5 changed files with 9 additions and 11 deletions

View File

@ -36,9 +36,9 @@ void CObjectList::RemoveObject(TUniqueId uid)
} }
else else
{ {
x0_list[ent.prev].next = ent.next;
if (ent.next != -1) if (ent.next != -1)
x0_list[ent.next].prev = -1; x0_list[ent.next].prev = ent.prev;
x0_list[ent.prev].next = -1;
} }
ent.entity = nullptr; ent.entity = nullptr;
ent.next = -1; ent.next = -1;

View File

@ -747,7 +747,7 @@ void CStateManager::DrawWorld() const
bool isVisArea = area.x4_selfIdx == visAreaId; bool isVisArea = area.x4_selfIdx == visAreaId;
SetupFogForArea(area); SetupFogForArea(area);
g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel); g_Renderer->SetWorldLightFadeLevel(area.GetPostConstructed()->x1128_worldLightingLevel);
for (CEntity* ent : *area.GetPostConstructed()->x10c0_areaObjs) for (CEntity* ent : *area.GetAreaObjects())
{ {
if (TCastToPtr<CActor> actor = ent) if (TCastToPtr<CActor> actor = ent)
{ {

View File

@ -88,7 +88,6 @@ std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words,
u32 bsWords = ComputeBitstreamWords(chans); u32 bsWords = ComputeBitstreamWords(chans);
u32* bsPtr = reinterpret_cast<u32*>(bs); u32* bsPtr = reinterpret_cast<u32*>(bs);
size_t wordsz = bsPtr - ret.get();
for (u32 w=0 ; w<bsWords ; ++w) for (u32 w=0 ; w<bsWords ; ++w)
bsPtr[w] = in.readUint32Big(); bsPtr[w] = in.readUint32Big();

View File

@ -186,12 +186,11 @@ void Buckets::Init()
sMinMaxDistance[1] = skWorstMinMaxDistance[1]; sMinMaxDistance[1] = skWorstMinMaxDistance[1];
} }
CBooRenderer::CAreaListItem::CAreaListItem CBooRenderer::CAreaListItem::CAreaListItem(const std::vector<CMetroidModelInstance>* geom,
(const std::vector<CMetroidModelInstance>* geom, const CAreaRenderOctTree* octTree,
const CAreaRenderOctTree* octTree, std::vector<TCachedToken<CTexture>>&& textures,
std::vector<TCachedToken<CTexture>>&& textures, std::vector<CBooModel*>&& models, int areaIdx,
std::vector<CBooModel*>&& models, int areaIdx, const SShader* shaderSet)
const SShader* shaderSet)
: x0_geometry(geom), x4_octTree(octTree), x8_textures(std::move(textures)), : x0_geometry(geom), x4_octTree(octTree), x8_textures(std::move(textures)),
x10_models(std::move(models)), x18_areaIdx(areaIdx), m_shaderSet(shaderSet) {} x10_models(std::move(models)), x18_areaIdx(areaIdx), m_shaderSet(shaderSet) {}

View File

@ -1965,7 +1965,7 @@ bool CElementGen::IsSystemDeletable() const
rstl::optional_object<zeus::CAABox> CElementGen::GetBounds() const rstl::optional_object<zeus::CAABox> CElementGen::GetBounds() const
{ {
if (GetParticleCountAll() == 0) if (GetParticleCountAll() == 0)
return {zeus::CAABox()}; return {};
else else
return {x2f0_systemBounds}; return {x2f0_systemBounds};
} }