Skip to content

Commit

Permalink
add ew_projectile_position_sync tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bgkillas committed Dec 14, 2024
1 parent 8d8eda8 commit be0de56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions noita-proxy/src/net/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,8 @@ impl WorldManager {
};
let dx = close_x - x;
let dy = close_y - y;
dx * dx + dy * dy <= r * r //TODO find good radius
let d = dx * dx + dy * dy;
d <= r * r //TODO find good radius
} {
let mut chunk = Chunk::default();
let coord = ChunkCoord(chunk_x, chunk_y);
Expand Down Expand Up @@ -1403,4 +1404,4 @@ impl Drop for WorldManager {

impl SaveStateEntry for FxHashMap<ChunkCoord, ChunkData> {
const FILENAME: &'static str = "world_chunks";
}
}
3 changes: 2 additions & 1 deletion quant.ew/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
or n == "data/entities/projectiles/deck/black_hole.xml"
or n == "data/entities/projectiles/deck/black_hole_giga.xml"
or n == "data/entities/projectiles/deck/white_hole.xml"
or n == "data/entities/projectiles/deck/white_hole_giga.xml" then
or n == "data/entities/projectiles/deck/white_hole_giga.xml"
or EntityHasTag(projectile_id, "ew_projectile_position_sync") then
EntityAddComponent2(projectile_id, "VariableStorageComponent", {_tags="ew_global_item_id",
value_string = shooter_player_data.peer_id .. ":" .. rng})
EntityAddTag(projectile_id, "ew_global_item")
Expand Down

0 comments on commit be0de56

Please sign in to comment.