From abd7cc26b609ff33fbacad3bc074ada19a332fbd Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 12 Apr 2020 14:24:52 -0700 Subject: [PATCH 1/2] update async+futures --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 09bf365..16c0850 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ path = "src/main.rs" [dependencies] libpso = { git = "http://git.sharnoth.com/jake/libpso" } -async-std = { version = "1.4.0", features = ["unstable"] } -futures = "0.3.1" +async-std = { version = "1.5.0", features = ["unstable"] } +futures = "0.3.4" rand = "0.7.3" rand_chacha = "0.2.2" mio = "0.6" From fd33fa751ab8a83d0fd24a6c4078f806482e18d3 Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 12 Apr 2020 14:27:06 -0700 Subject: [PATCH 2/2] problem: initializing the drop table blows up the stack no matter how large I make it solution: put it on the goddamn heap --- src/ship/room.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ship/room.rs b/src/ship/room.rs index 2695362..73f226b 100644 --- a/src/ship/room.rs +++ b/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>, // 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)), }) }