diff options
| author | troido <troido@protonmail.com> | 2020-05-19 10:40:22 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-05-19 10:40:22 +0200 |
| commit | 0d382ea19f8f964c35761f6a3ff80bc9bfc25375 (patch) | |
| tree | 051abe24e22edd6aa0c6b9a9efbd03b8c47ce260 /src/room.rs | |
| parent | 78b079df5a26ce94142737605ec36ddde8310336 (diff) | |
add room build permissions to rooms
Diffstat (limited to 'src/room.rs')
| -rw-r--r-- | src/room.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/room.rs b/src/room.rs index d0f22df..0b8ee3b 100644 --- a/src/room.rs +++ b/src/room.rs @@ -22,7 +22,8 @@ use crate::{ Spawn as SpawnPosition, Players, Emigration, - Time + Time, + RoomPermissions }, components::{ Position, @@ -125,7 +126,7 @@ impl <'a, 'b>Room<'a, 'b> { register_insert!( world, (Position, Visible, Controller, Movable, New, Removed, Moved, Player, Inventory, Health, Serialise, RoomExit, Entered, TriggerBox, Trap, Fighter, Healing, ControlCooldown, Autofight, MonsterAI, Home, AttackInbox, Item, Spawner, Clan, Faction, Interactable, Loot, Timer, Equipment, TimeOffset, Flags, Ear, Build, Whitelist, Dedup, Minable, LootHolder, OnSpawn, Substitute), - (Ground, Input, Output, Size, Spawn, Players, Emigration, Time) + (Ground, Input, Output, Size, Spawn, Players, Emigration, Time, RoomPermissions) ); Room { @@ -143,6 +144,7 @@ impl <'a, 'b>Room<'a, 'b> { self.world.fetch_mut::<Size>().height = height; self.world.fetch_mut::<SpawnPosition>().pos = template.spawn; + self.world.insert::<RoomPermissions>(template.permissions.clone()); for (idx, templates) in template.field.iter().enumerate() { let x = (idx as i64) % width; |
