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
{
x0_list[ent.prev].next = ent.next;
if (ent.next != -1)
x0_list[ent.next].prev = -1;
x0_list[ent.prev].next = -1;
x0_list[ent.next].prev = ent.prev;
}
ent.entity = nullptr;
ent.next = -1;

View File

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

View File

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

View File

@ -186,8 +186,7 @@ void Buckets::Init()
sMinMaxDistance[1] = skWorstMinMaxDistance[1];
}
CBooRenderer::CAreaListItem::CAreaListItem
(const std::vector<CMetroidModelInstance>* geom,
CBooRenderer::CAreaListItem::CAreaListItem(const std::vector<CMetroidModelInstance>* geom,
const CAreaRenderOctTree* octTree,
std::vector<TCachedToken<CTexture>>&& textures,
std::vector<CBooModel*>&& models, int areaIdx,

View File

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