From 910597e92dc66a5bbcf5a4377d75ff662834ff5c Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Sat, 7 Feb 2026 20:32:15 -0500 Subject: [PATCH] Broaden type hints to Entity where applicable --- src/mudlib/commands/movement.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)