mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-10 02:21:33 -10:00
Boats: keep the ticked list only while a mod hears the ticks
Without mods the round doesn't listen and the Posts send nothing, so the per-tick list of ticked boats (an entry and a kind per boat) isn't built. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4fe32489bd
commit
ae295952ce
1 file changed
+4
-2
@@ -725,7 +725,7 @@ impl Game<'_> {
|
||||
let driven = self.guest_vehicles();
|
||||
// EntityTickEvent.Post comes once AbstractBoat.tick is over, after the
|
||||
// passes below (lava, ejection, bubbles, contacts): the ticked boats,
|
||||
// in order.
|
||||
// in order, kept only while a mod listens (no list without mods).
|
||||
let mut ticked = Vec::new();
|
||||
for i in 0..self.boats.len() {
|
||||
// A mod's hook may have removed boats.
|
||||
@@ -763,7 +763,9 @@ impl Game<'_> {
|
||||
};
|
||||
let b = self.boats[i].clone();
|
||||
self.boats[i] = self.tick_boat(b, false);
|
||||
ticked.push((id, kind));
|
||||
if round.listening() {
|
||||
ticked.push((id, kind));
|
||||
}
|
||||
}
|
||||
// AbstractBoat.tick's applyEffectsFromBlocks, on the server for every
|
||||
// boat, the client-driven ones too.
|
||||
|
||||
Reference in new issue
Block a user