From fd33fa751ab8a83d0fd24a6c4078f806482e18d3 Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 12 Apr 2020 14:27:06 -0700 Subject: [PATCH] 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)), }) }