Skip to content

Commit

Permalink
Fix crashes in Clear Sky after e3868c2 (#382, #392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Apr 10, 2023
1 parent 331de93 commit 7bf5514
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/xrGame/alife_anomalous_zone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,19 @@ void CSE_ALifeAnomalousZone::spawn_artefacts()
typedef buffer_vector<Weight> Weights;
Weights weights(xr_alloca(n * sizeof(Weight)), n);

u32 missing_artefacts = 0;
for (u32 i = 0; i < n; ++i)
{
string256 temp0, temp1;
_GetItem(artefacts, 2 * i + 0, temp0);
if (!pSettings->section_exist(temp0))
{
#ifndef MASTER_GOLD
Msg("! [%s] wants to spawn artefact [%s] with missing INI section.", name(), temp0);
#endif
++missing_artefacts;
continue;
}
_GetItem(artefacts, 2 * i + 1, temp1);
weights.push_back(
std::make_pair(
Expand All @@ -89,6 +98,7 @@ void CSE_ALifeAnomalousZone::spawn_artefacts()
)
);
}
n -= missing_artefacts;

for (u32 i = 0; i < artefact_count; ++i)
{
Expand Down

0 comments on commit 7bf5514

Please sign in to comment.