mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix some explosion logic from last commits
This commit is contained in:
parent
2cd5c30857
commit
6de1cd2278
4 changed files with 11 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
# List of available hooks:
|
||||
|
||||
- `ctx.hook.on_world_initialized()` - called on OnWorldInitialized.
|
||||
- `ctx.hook.on_new_entity(ent)` - called on new alive entity.
|
||||
- `ctx.hook.on_world_update()` - called on OnWorldPreUpdate.
|
||||
- `ctx.hook.on_world_update_client()` - called on OnWorldPreUpdate, but only on clients.
|
||||
- `ctx.hook.on_world_update_host()` - called on OnWorldPreUpdate, but only on host.
|
||||
|
@ -11,4 +12,4 @@
|
|||
- `ctx.hook.on_draw_debug_window(imgui)`
|
||||
- `ctx.hook.on_local_player_polymorphed(currently_polymorphed)`
|
||||
- `ctx.hook.on_client_polymorphed(peer_id, player_data)`
|
||||
- `ctx.hook.on_late_init()` - called on OnModPostInit.
|
||||
- `ctx.hook.on_late_init()` - called on OnModPostInit.
|
|
@ -166,9 +166,11 @@ end
|
|||
|
||||
local exists
|
||||
|
||||
local new_ents = {}
|
||||
|
||||
function mod.on_new_entity(ent)
|
||||
if ctx.is_host then
|
||||
update(ent, 1)
|
||||
table.insert(new_ents, ent)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -226,6 +228,10 @@ function mod.on_world_pre_update()
|
|||
count2 = count2 - update(ent, count2)
|
||||
end
|
||||
end
|
||||
for _, ent in ipairs(new_ents) do
|
||||
update(ent, 1)
|
||||
end
|
||||
new_ents = {}
|
||||
if exists then
|
||||
net.proxy_send("flush_exp", "")
|
||||
exists = nil
|
||||
|
|
|
@ -146,4 +146,4 @@ function tele.on_world_update()
|
|||
end
|
||||
end
|
||||
|
||||
return tele
|
||||
return tele
|
||||
|
|
|
@ -677,4 +677,4 @@ end
|
|||
function OnPlayerDied(player_entity)
|
||||
ctx.hook.on_player_died(player_entity)
|
||||
print("player died")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue