aboutsummaryrefslogtreecommitdiff
path: root/server/protocol/src/movement.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-16 19:19:02 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-16 19:19:02 +0200
commitd29035fe985bbea44111fc9bf9ddf454ffa81379 (patch)
tree64ac17bb471d3701271c525054e02c13980146bd /server/protocol/src/movement.rs
parent8fdc97c466bcb7c2ba0d1b5f4aa0aaf95063b74e (diff)
downloadhurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar
hurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar.bz2
hurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar.zst
interacting with light
Diffstat (limited to 'server/protocol/src/movement.rs')
-rw-r--r--server/protocol/src/movement.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/protocol/src/movement.rs b/server/protocol/src/movement.rs
index 486da816..5a96155f 100644
--- a/server/protocol/src/movement.rs
+++ b/server/protocol/src/movement.rs
@@ -81,6 +81,10 @@ impl MovementBase {
rot: self.rotation,
}
}
+
+ pub fn get_interact_target(&self) -> IVec2 {
+ (self.position + Vec2::new(self.rotation.sin(), self.rotation.cos())).as_ivec2()
+ }
}
pub fn collide_player(p: &mut MovementBase, map: &HashSet<IVec2>) {