Browse Source

problem: initializing the drop table blows up the stack no matter how

large I make it
solution: put it on the goddamn heap
pbs
jake 5 years ago
parent
commit
fd33fa751a
  1. 5
      src/ship/room.rs

5
src/ship/room.rs

@ -119,14 +119,13 @@ impl RoomMode {
}
#[derive(Debug)]
pub struct RoomState {
pub mode: RoomMode,
pub name: String,
pub password: [u16; 16],
//pub maps: [u32; 0x20],
pub maps: Maps,
// drop_table
pub drop_table: Box<DropTable<rand_chacha::ChaCha20Rng>>,
// items on ground
// enemy info
}
@ -201,8 +200,8 @@ impl RoomState {
mode: room_mode,
name: String::from_utf16_lossy(&create_room.name).trim_matches(char::from(0)).into(),
password: create_room.password,
//maps: [0; 0x20],
maps: Maps::new(room_mode.episode()),
drop_table: Box::new(DropTable::new(room_mode.episode(), room_mode.difficulty(), section_id)),
})
}

Loading…
Cancel
Save