A few loader methods are dead and one is broken if ever revived.
1. SmaugAreaFile.load_room calls a method that doesn't exist.
https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L2017-L2030
def load_room(self, vnum):
...
line = self.read_line()
#room.sector_type, room.tele_delay, ... = map(int, line.split())
self.read_room_data(room)
return room
read_room_data is not defined anywhere in the package (grep finds only this call site), so calling load_room raises AttributeError. Nothing calls it — the live path is SmaugRoom.read — so this is leftover from an earlier design. read_line (line 2029) exists only to serve it.
2. AreaFile.jump_to_section silently mispositions when the section is missing.
https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L391-L392
def jump_to_section(self, section_name):
self.index = self.data.find('#'+section_name.upper()) + len(section_name) + 1
When find returns -1 the index becomes len(section_name), a meaningless offset near the start of the file, with no error. Verified:
>>> f.data = "#AREA\nstuff"; f.jump_to_section("NOSUCH"); f.index
6
No callers in the package or tests.
3. Triplicated helper. native_reset_arg2_suffix, native_merc_reset_arg2_suffix, and native_swr_reset_arg2_suffix (lines 590, 1705, 557) are byte-identical single-expression functions.
Suggest deleting 1 and 2 (or fixing jump_to_section to raise on a missing section if it's meant as public API) and collapsing 3 to one helper.
A few loader methods are dead and one is broken if ever revived.
1.
SmaugAreaFile.load_roomcalls a method that doesn't exist.https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L2017-L2030
read_room_datais not defined anywhere in the package (grep finds only this call site), so callingload_roomraisesAttributeError. Nothing calls it — the live path isSmaugRoom.read— so this is leftover from an earlier design.read_line(line 2029) exists only to serve it.2.
AreaFile.jump_to_sectionsilently mispositions when the section is missing.https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L391-L392
When
findreturns -1 the index becomeslen(section_name), a meaningless offset near the start of the file, with no error. Verified:No callers in the package or tests.
3. Triplicated helper.
native_reset_arg2_suffix,native_merc_reset_arg2_suffix, andnative_swr_reset_arg2_suffix(lines 590, 1705, 557) are byte-identical single-expression functions.Suggest deleting 1 and 2 (or fixing
jump_to_sectionto raise on a missing section if it's meant as public API) and collapsing 3 to one helper.