Skip to content

Commit d1ad955

Browse files
committed
Remove tabs
1 parent f82ad78 commit d1ad955

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/xrGame/alife_object.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ void CSE_ALifeObject::spawn_supplies(LPCSTR ini_string)
175175

176176
// probability
177177
if (strstr(V, "prob=") != nullptr)
178-
p = static_cast<float>(atof(strstr(V, "prob=") + 5));
179-
if (fis_zero(p))
180-
p = 1.0f;
178+
sscanf(strstr(V, "prob=") + 5, "%f", &p);
181179
if (strstr(V, "cond=") != nullptr)
182180
fCond = static_cast<float>(atof(strstr(V, "cond=") + 5));
183181
}
@@ -227,10 +225,12 @@ bool CSE_ALifeObject::is_spawn_supplies_flag_set(pcstr value, pcstr flag)
227225
return true;
228226
}
229227

230-
float probability = static_cast<float>(atof(flagSubstring + flagLength + 1));
228+
float probability = 1.0;
231229

232-
// Assume 0 is 1 for cases like `flag=,flag=\n` and consistency with `prob` calculations.
233-
return fis_zero(probability) ? true : randF(1.f) <= probability;
230+
if (sscanf(flagSubstring + flagLength + 1, "%f", &probability) == 1)
231+
return randF(1.f) <= probability;
232+
else
233+
return true;
234234
}
235235
// Short variant of flag without assigned value.
236236
else

0 commit comments

Comments
 (0)