mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Sanitize invalid particle spawner time (#15465)
This commit is contained in:
parent
11b19cd126
commit
b77ad82fb9
3 changed files with 8 additions and 0 deletions
|
@ -270,6 +270,7 @@ ParticleSpawner::ParticleSpawner(
|
|||
}
|
||||
|
||||
size_t max_particles = 0; // maximum number of particles likely to be visible at any given time
|
||||
assert(p.time >= 0);
|
||||
if (p.time != 0) {
|
||||
auto maxGenerations = p.time / std::min(p.exptime.start.min, p.exptime.end.min);
|
||||
max_particles = p.amount / maxGenerations;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue