throw if Ep3 player start location not set
This commit is contained in:
@@ -1352,17 +1352,21 @@ void PlayerState::set_initial_location() {
|
|||||||
this->start_facing_direction = facing_direction;
|
this->start_facing_direction = facing_direction;
|
||||||
mr->start_facing_directions |= (static_cast<uint16_t>(this->start_facing_direction) << (this->client_id << 2));
|
mr->start_facing_directions |= (static_cast<uint16_t>(this->start_facing_direction) << (this->client_id << 2));
|
||||||
|
|
||||||
for (size_t y = 0; y < 0x10; y++) {
|
bool start_tile_found = false;
|
||||||
for (size_t x = 0; x < 0x10; x++) {
|
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)) {
|
if (mr->map.tiles[y][x] == (player_start_tile & 0x3F)) {
|
||||||
this->sc_card->loc.x = x;
|
this->sc_card->loc.x = x;
|
||||||
this->sc_card->loc.y = y;
|
this->sc_card->loc.y = y;
|
||||||
this->sc_card->loc.direction = facing_direction;
|
this->sc_card->loc.direction = facing_direction;
|
||||||
y = 0x10;
|
start_tile_found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!start_tile_found) {
|
||||||
|
throw runtime_error("player start location not set");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerState::set_map_occupied_bit_for_card_on_warp_tile(
|
void PlayerState::set_map_occupied_bit_for_card_on_warp_tile(
|
||||||
|
|||||||
Reference in New Issue
Block a user