Skip to content

Commit 6de1cd2

Browse files
committed
fix some explosion logic from last commits
1 parent 2cd5c30 commit 6de1cd2

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

docs/hooks.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# List of available hooks:
22

33
- `ctx.hook.on_world_initialized()` - called on OnWorldInitialized.
4+
- `ctx.hook.on_new_entity(ent)` - called on new alive entity.
45
- `ctx.hook.on_world_update()` - called on OnWorldPreUpdate.
56
- `ctx.hook.on_world_update_client()` - called on OnWorldPreUpdate, but only on clients.
67
- `ctx.hook.on_world_update_host()` - called on OnWorldPreUpdate, but only on host.
@@ -11,4 +12,4 @@
1112
- `ctx.hook.on_draw_debug_window(imgui)`
1213
- `ctx.hook.on_local_player_polymorphed(currently_polymorphed)`
1314
- `ctx.hook.on_client_polymorphed(peer_id, player_data)`
14-
- `ctx.hook.on_late_init()` - called on OnModPostInit.
15+
- `ctx.hook.on_late_init()` - called on OnModPostInit.

quant.ew/files/system/explosion_cuts/explosion_cuts.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ end
166166

167167
local exists
168168

169+
local new_ents = {}
170+
169171
function mod.on_new_entity(ent)
170172
if ctx.is_host then
171-
update(ent, 1)
173+
table.insert(new_ents, ent)
172174
end
173175
end
174176

@@ -226,6 +228,10 @@ function mod.on_world_pre_update()
226228
count2 = count2 - update(ent, count2)
227229
end
228230
end
231+
for _, ent in ipairs(new_ents) do
232+
update(ent, 1)
233+
end
234+
new_ents = {}
229235
if exists then
230236
net.proxy_send("flush_exp", "")
231237
exists = nil

quant.ew/files/system/telekenisis/telekenisis.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,4 @@ function tele.on_world_update()
146146
end
147147
end
148148

149-
return tele
149+
return tele

quant.ew/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,4 +677,4 @@ end
677677
function OnPlayerDied(player_entity)
678678
ctx.hook.on_player_died(player_entity)
679679
print("player died")
680-
end
680+
end

0 commit comments

Comments
 (0)