beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
223 stars 102 forks source link

`Spring.GetCEGID("nonexistent ceg")` allocates a new ID #1779

Open sprunk opened 5 days ago

sprunk commented 5 days ago
sprunk commented 5 days ago

It should be a matter of splitting the "find generator" part away from CExplosionGeneratorHandler::LoadGenerator and using that in Spring.GetCEGID instead of the full function that allocates a new one if missing: https://github.com/beyond-all-reason/spring/blob/7363dbc54b55d309539b92c60245f88afd1f4e4a/rts/Sim/Projectiles/ExplosionGenerator.cpp#L296-L309