YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Calling part_type_destroy() on a type used by a particle system asset destroys the particle type #8019

Open YYBartT opened 4 days ago

YYBartT commented 4 days ago

Description

Calling part_type_destroy() on a type used by a particle system asset destroys the particle type. Particle systems created from that asset no longer draw the particles of that type.

The following code attempts to destroy the particle type used by a particle system asset:

/// Create Event
var _info = particle_get_info(ps_test);
var _em = _info.emitters[0];
var _ind = _em.parttype.ind;
show_debug_message($"Particle Type ID: {_ind}");

part_type_destroy(_ind);  // Attempt to destroy the particle type used by the asset
ps = part_system_create(ps_test);

The particle system draws correctly if the part_type_destroy(_ind); line is commented out.

Code example in this sample project: test_ps_asset.zip

Expected Change

Particle types used by assets cannot be destroyed, an error could be thrown when attempting to do this

Steps To Reproduce

  1. Start GameMaker
  2. Open the sample project and run it => nothing is drawn
  3. Comment out the line part_type_destroy(_ind); and run the project again => the particle system is drawn correctly

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.8.1 (Monthly)

Which platform(s) are you seeing the problem on?

Windows

Sample Package Attached?

Sample Project Added?

stuckie commented 4 days ago

Would you expect that attempting to draw without a particle type display an error in this situation?

stuckie commented 3 days ago

Discussion earlier was that yes, we'd expect an error trying to draw an incomplete particle system.