throw if Ep3 player start location not set

This commit is contained in:
Martin Michelsen
2024-01-03 09:40:43 -08:00
parent ec99dad874
commit 0e9f66f72e
+7 -3
View File
@@ -1352,17 +1352,21 @@ void PlayerState::set_initial_location() {
this->start_facing_direction = facing_direction;
mr->start_facing_directions |= (static_cast<uint16_t>(this->start_facing_direction) << (this->client_id << 2));
for (size_t y = 0; y < 0x10; y++) {
for (size_t x = 0; x < 0x10; x++) {
bool start_tile_found = false;
for (size_t y = 0; (y < 0x10) && !start_tile_found; y++) {
for (size_t x = 0; (x < 0x10) && !start_tile_found; x++) {
if (mr->map.tiles[y][x] == (player_start_tile & 0x3F)) {
this->sc_card->loc.x = x;
this->sc_card->loc.y = y;
this->sc_card->loc.direction = facing_direction;
y = 0x10;
start_tile_found = true;
break;
}
}
}
if (!start_tile_found) {
throw runtime_error("player start location not set");
}
}
void PlayerState::set_map_occupied_bit_for_card_on_warp_tile(