Refactor ROM handling and update Overworld methods
Updated MessageEditor, RoomEntrance, and Overworld classes to use WriteByte instead of Write for byte values. Refactored ROM class by removing Write and toint16 methods, moving constants, and updating operator[]. Modified Overworld methods to return absl::Status and handle errors. Updated Inventory and OverworldMap methods to use ReadWord instead of toint16.
This commit is contained in:
@@ -71,7 +71,13 @@ void OverworldMap::LoadAreaInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
message_id_ = rom_.toint16(kOverworldMessageIds + (parent_ * 2));
|
||||
auto message_id = rom_.ReadWord(kOverworldMessageIds + (parent_ * 2));
|
||||
if (message_id.ok()) {
|
||||
message_id_ = message_id.value();
|
||||
} else {
|
||||
message_id_ = 0;
|
||||
core::logf("Error reading message id for map %d", parent_);
|
||||
}
|
||||
|
||||
if (index_ < kDarkWorldMapIdStart) {
|
||||
area_graphics_ = rom_[kAreaGfxIdPtr + parent_];
|
||||
|
||||
Reference in New Issue
Block a user