@@ -134,7 +134,7 @@ impl LocalDiffModelTracker {
134134 let entity = self . entity_by_lid ( lid) ?;
135135
136136 if !entity. is_alive ( ) {
137- self . untrack_entity ( ctx, gid, lid) ?;
137+ self . untrack_entity ( ctx, gid, lid, None ) ?;
138138 return Ok ( ( ) ) ;
139139 }
140140 let item_and_was_picked = info. kind == EntityKind :: Item && item_in_inventory ( entity) ?;
@@ -362,10 +362,11 @@ impl LocalDiffModelTracker {
362362 ctx : & mut ModuleCtx < ' _ > ,
363363 gid : Gid ,
364364 lid : Lid ,
365+ ent : Option < NonZero < isize > > ,
365366 ) -> Result < ( ) , eyre:: Error > {
366367 self . pending_removal . push ( lid) ;
367368 ctx. net . send ( & NoitaOutbound :: DesToProxy (
368- shared:: des:: DesToProxy :: DeleteEntity ( gid) ,
369+ shared:: des:: DesToProxy :: DeleteEntity ( gid, ent ) ,
369370 ) ) ?;
370371
371372 Ok ( ( ) )
@@ -378,7 +379,7 @@ impl LocalDiffModelTracker {
378379 lid : Lid ,
379380 entity : EntityID ,
380381 ) -> Result < ( ) , eyre:: Error > {
381- self . untrack_entity ( ctx, gid, lid) ?;
382+ self . untrack_entity ( ctx, gid, lid, Some ( entity . 0 ) ) ?;
382383 entity. remove_tag ( DES_TAG ) ?;
383384 with_entity_scripts ( entity, |luac| {
384385 luac. set_script_throw_item (
@@ -596,7 +597,7 @@ impl LocalDiffModel {
596597 . wrap_err ( "Failed to update local entity" )
597598 {
598599 print_error ( error) ?;
599- self . tracker . untrack_entity ( ctx, * gid, lid) ?;
600+ self . tracker . untrack_entity ( ctx, * gid, lid, None ) ?;
600601 }
601602 }
602603 Ok ( ( ) )
@@ -1601,6 +1602,10 @@ fn _safe_wandkill(entity: EntityID) -> eyre::Result<()> {
16011602 lc. set_script_source_file (
16021603 "mods/quant.ew/files/system/entity_sync_helper/scripts/killself.lua" . into ( ) ,
16031604 ) ?;
1605+ entity. set_component_enabled ( * lc, true ) ?;
1606+ lc. add_tag ( "enabled_in_inventory" ) ?;
1607+ lc. add_tag ( "enabled_in_world" ) ?;
1608+ lc. add_tag ( "enabled_in_hand" ) ?;
16041609 lc. set_execute_on_added ( false ) ?;
16051610 lc. set_m_next_execution_time ( noita_api:: raw:: game_get_frame_num ( ) ? + 1 ) ?;
16061611 Ok ( ( ) )
0 commit comments