diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-16 19:19:02 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-16 19:19:02 +0200 |
commit | d29035fe985bbea44111fc9bf9ddf454ffa81379 (patch) | |
tree | 64ac17bb471d3701271c525054e02c13980146bd /server/protocol/src | |
parent | 8fdc97c466bcb7c2ba0d1b5f4aa0aaf95063b74e (diff) | |
download | hurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar hurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar.bz2 hurrycurry-d29035fe985bbea44111fc9bf9ddf454ffa81379.tar.zst |
interacting with light
Diffstat (limited to 'server/protocol/src')
-rw-r--r-- | server/protocol/src/movement.rs | 4 |
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>) { |