diff --git a/src/mudlib/commands/movement.py b/src/mudlib/commands/movement.py index 0c10a8f..59a5ac4 100644 --- a/src/mudlib/commands/movement.py +++ b/src/mudlib/commands/movement.py @@ -3,6 +3,7 @@ from typing import Any from mudlib.commands import CommandDefinition, register +from mudlib.entity import Entity from mudlib.player import Player, players # World instance will be injected by the server @@ -93,11 +94,11 @@ async def move_player(player: Player, dx: int, dy: int, direction_name: str) -> await cmd_look(player, "") -async def send_nearby_message(player: Player, x: int, y: int, message: str) -> None: - """Send a message to all players near a location, excluding the player. +async def send_nearby_message(entity: Entity, x: int, y: int, message: str) -> None: + """Send a message to all players near a location, excluding the entity. Args: - player: The player who triggered the message (excluded from receiving it) + entity: The entity who triggered the message (excluded from receiving it) x: X coordinate of the location y: Y coordinate of the location message: The message to send @@ -106,7 +107,7 @@ async def send_nearby_message(player: Player, x: int, y: int, message: str) -> N viewport_range = 10 for other in players.values(): - if other.name == player.name: + if other.name == entity.name: continue # Check if other player is within viewport range (wrapping)