Skip to content

Commit 04e1185

Browse files
committed
fix snow crystal and a bug with past few
1 parent 65bb3fd commit 04e1185

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ewext/src/modules/entity_sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl Module for EntitySync {
259259

260260
/// Looks for newly spawned entities that might need to be tracked.
261261
fn on_new_entity(&mut self, entity: EntityID, ctx: &mut super::ModuleCtx) -> eyre::Result<()> {
262-
if entity.0 < self.look_current_entity.0 {
262+
if entity.0 <= self.look_current_entity.0 {
263263
return Ok(());
264264
}
265265
if !entity.is_alive() || self.dont_track.remove(&entity) {

ewext/src/modules/entity_sync/diff_model.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ use noita_api::{
1010
CharacterDataComponent, CharacterPlatformingComponent, DamageModelComponent, EntityID,
1111
ExplodeOnDamageComponent, GhostComponent, IKLimbAttackerComponent, IKLimbComponent,
1212
IKLimbWalkerComponent, IKLimbsAnimatorComponent, Inventory2Component, ItemComponent,
13-
ItemCostComponent, ItemPickUpperComponent, LaserEmitterComponent, LuaComponent, PhysData,
14-
PhysicsAIComponent, PhysicsBody2Component, PhysicsBodyComponent, SpriteComponent,
15-
StreamingKeepAliveComponent, VariableStorageComponent, VelocityComponent, WormComponent,
13+
ItemCostComponent, ItemPickUpperComponent, LaserEmitterComponent, LifetimeComponent,
14+
LuaComponent, PhysData, PhysicsAIComponent, PhysicsBody2Component, PhysicsBodyComponent,
15+
SpriteComponent, StreamingKeepAliveComponent, VariableStorageComponent, VelocityComponent,
16+
WormComponent,
1617
};
1718
use rustc_hash::{FxHashMap, FxHashSet};
1819
use shared::des::TRANSFER_RADIUS;
@@ -1751,6 +1752,7 @@ pub fn init_remote_entity(
17511752
"data/scripts/buildings/statue_hand_state.lua",
17521753
"data/scripts/buildings/failed_alchemist_orb.lua",
17531754
"data/scripts/buildings/ghost_crystal.lua",
1755+
"data/scripts/buildings/snowcrystal.lua",
17541756
]
17551757
.contains(&&*lua.script_source_file()?)
17561758
|| ["data/scripts/items/die_roll.lua"].contains(&&*lua.script_enabled_changed()?)
@@ -1780,6 +1782,11 @@ pub fn init_remote_entity(
17801782
lua.set_script_death("data/scripts/animals/boss_dragon_death.lua".into())?;
17811783
lua.set_execute_every_n_frame(-1)?;
17821784
}
1785+
if let Some(life) =
1786+
entity.try_get_first_component_including_disabled::<LifetimeComponent>(None)?
1787+
{
1788+
life.set_lifetime(i32::MAX)?;
1789+
}
17831790
if let Some(pickup) =
17841791
entity.try_get_first_component_including_disabled::<ItemPickUpperComponent>(None)?
17851792
{

0 commit comments

Comments
 (0)