diff --git a/source/effects/particle_systems.c b/source/effects/particle_systems.c index 778f8063..a2785e23 100644 --- a/source/effects/particle_systems.c +++ b/source/effects/particle_systems.c @@ -121,6 +121,17 @@ void particle_systems_initialize_for_new_map( return; } +void particle_system_orphan( + long system_index) +{ + struct particle_system_datum *system = particle_system_get(system_index); + + SET_FLAG(system->flags, _particle_system_attached_bit, FALSE); + system->object_index = NONE; + + return; +} + void particle_systems_dispose_from_old_map( void) { diff --git a/source/effects/particle_systems.h b/source/effects/particle_systems.h index d20ffa55..03450ca1 100644 --- a/source/effects/particle_systems.h +++ b/source/effects/particle_systems.h @@ -13,10 +13,32 @@ header included in hcex build. /* ---------- constants */ +enum +{ + _particle_system_attached_bit, +}; + /* ---------- macros */ +#define particle_system_get(system_index) ((struct particle_system_datum *)datum_get(particle_systems, (system_index))) + /* ---------- structures */ +struct particle_system_datum +{ + struct datum_header header; + short pad; + unsigned long flags; + long definition_index; + long object_index; + short attachment_index; + short type_state_index; + byte opaque[0x144]; +}; + +typedef char particle_system_datum_size_assert[ + sizeof(struct particle_system_datum) == 0x158 ? 1 : -1]; + /* ---------- prototypes/PARTICLE_SYSTEMS.C */ void particle_systems_initialize( @@ -31,7 +53,8 @@ void particle_systems_disconnect_from_structure_bsp( void); long particle_system_new_attached(long definition_index, long object_index, short attachment_index); -void particle_system_orphan(long system_index); +void particle_system_orphan( + long system_index); /* ---------- globals */