From 0d382ea19f8f964c35761f6a3ff80bc9bfc25375 Mon Sep 17 00:00:00 2001 From: troido Date: Tue, 19 May 2020 10:40:22 +0200 Subject: add room build permissions to rooms --- src/room.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/room.rs') 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::().height = height; self.world.fetch_mut::().pos = template.spawn; + self.world.insert::(template.permissions.clone()); for (idx, templates) in template.field.iter().enumerate() { let x = (idx as i64) % width; -- cgit