From 76d561f003cb17b4549b7783b1412ffba23d70f2 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Wed, 17 Apr 2013 00:45:36 -0700 Subject: [PATCH] Activated magboots will now, definitely, prevent airflow based grieving of your personage. (Included is a possible fix for airflow opening doors by throwing you at them) Added in code to debug ZAS tile interactions, currently in the unchecked "Debug" file. The blasted FloodFill proc now works properly, and zones are connecting right (Should finally fix that damn part of medbay not connecting to the hallway) Plasma can contaminate again. The master controller and world startup code has been reworked for faster server boots. Fixed a runtime originating from a Away Mission map trying to create objects of type "null" --- code/ZAS/Airflow.dm | 4 +-- code/ZAS/Debug.dm | 44 +++++++++++++++++++++++++++ code/ZAS/FEA_system.dm | 2 +- code/ZAS/Functions.dm | 23 ++++++++++++-- code/ZAS/Plasma.dm | 1 - code/controllers/master_controller.dm | 13 ++++---- code/game/machinery/doors/door.dm | 2 +- code/modules/awaymissions/loot.dm | 16 +++++++--- code/world.dm | 7 +++-- 9 files changed, 91 insertions(+), 21 deletions(-) diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index 167d4368b3c..e51542c3eb7 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -248,8 +248,8 @@ atom/movable if(src:buckled) return if(src:shoes) - if(src:shoes.type == /obj/item/clothing/shoes/magboots) - if(src:shoes.flags & NOSLIP) + if(istype(src:shoes, /obj/item/clothing/shoes/magboots)) + if(src:shoes:magpulse) return src << "\red You are sucked away by airflow!" var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful. diff --git a/code/ZAS/Debug.dm b/code/ZAS/Debug.dm index 186ed65ae8e..e4e07f5cd8a 100644 --- a/code/ZAS/Debug.dm +++ b/code/ZAS/Debug.dm @@ -12,6 +12,50 @@ client/verb/Zone_Info(turf/T as null|turf) T.overlays -= 'debug_group.dmi' T.overlays -= 'debug_connect.dmi' + + +client/verb/Test_ZAS_Connection(var/turf/simulated/T as turf) + set category = "Debug" + if(!istype(T)) + return + + var/direction_list = list(\ + "North" = NORTH,\ + "South" = SOUTH,\ + "East" = EAST,\ + "West" = WEST,\ + "None" = null) + var/direction = input("What direction do you wish to test?","Set direction") as null|anything in direction_list + if(!direction) + return + + if(direction == "None") + if(T.CanPass(null, T, 0,0)) + mob << "The turf can pass air! :D" + else + mob << "No air passage :x" + return + + var/turf/simulated/other_turf = get_step(T, direction_list[direction]) + if(!istype(other_turf)) + return + + var/pass_directions = T.CanPass(null, other_turf, 0, 0) + 2*other_turf.CanPass(null, T, 0, 0) + + switch(pass_directions) + if(0) + mob << "Neither turf can connect. :(" + + if(1) + mob << "The initial turf only can connect. :\\" + + if(2) + mob << "The other turf can connect, but not the initial turf. :/" + + if(3) + mob << "Both turfs can connect! :)" + + zone/proc DebugDisplay(mob/M) if(!dbg_output) diff --git a/code/ZAS/FEA_system.dm b/code/ZAS/FEA_system.dm index 58574baeb7e..1eadd31ed6b 100644 --- a/code/ZAS/FEA_system.dm +++ b/code/ZAS/FEA_system.dm @@ -346,7 +346,7 @@ datum if(current == NT) return //We made it, yaaay~ stepped_back = 0 - zone.rebuild = 1 + zone.rebuild = 1 else if ( current.air_check_directions&test_dir ) //Try to connect to the left hand side. diff --git a/code/ZAS/Functions.dm b/code/ZAS/Functions.dm index 47762f74a49..e7847bb2bd3 100644 --- a/code/ZAS/Functions.dm +++ b/code/ZAS/Functions.dm @@ -21,7 +21,24 @@ proc/FloodFill(turf/simulated/start) if(istype(O) && !(O in open) && !(O in closed) && O.ZCanPass(T)) - if(!O.HasDoor()) + if(T.HasDoor()) + //If they both have doors, then they are nto able to connect period. + if(O.HasDoor()) + continue + + //connect first to north and west + if(d == NORTH || d == WEST) + open += O + + else + var/turf/simulated/W = get_step(O, WEST) + var/turf/simulated/N = get_step(O, NORTH) + + if( !O.ZCanPass(N) && !O.ZCanPass(W) ) + //If it cannot connect either to the north or west, connect it! + open += O + + else if(!O.HasDoor()) open += O else @@ -108,8 +125,10 @@ proc/ZConnect(turf/simulated/A,turf/simulated/B) //Make some preliminary checks to see if the connection is valid. if(!A.zone || !B.zone) return if(A.zone == B.zone) return + if(!A.CanPass(null,B,0,0)) return - if(A.CanPass(null,B,1.5,1)) + + if(A.CanPass(null,B,0,1)) return ZMerge(A.zone,B.zone) //Ensure the connection isn't already made. diff --git a/code/ZAS/Plasma.dm b/code/ZAS/Plasma.dm index e9a91fee4bb..437ac592a2a 100644 --- a/code/ZAS/Plasma.dm +++ b/code/ZAS/Plasma.dm @@ -42,7 +42,6 @@ obj/var/contaminated = 0 obj/item/proc can_contaminate() - return 0 //Clothing and backpacks can be contaminated. if(flags & PLASMAGUARD) return 0 else if(istype(src,/obj/item/clothing)) return 1 diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index bdbe50b31a3..2880d034e98 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -38,12 +38,6 @@ datum/controller/game_controller/New() del(master_controller) master_controller = src - createRandomZlevel() - - if(!air_master) - air_master = new /datum/controller/air_system() - air_master.setup() - if(!job_master) job_master = new /datum/controller/occupations() job_master.SetupOccupations() @@ -55,10 +49,15 @@ datum/controller/game_controller/New() if(!ticker) ticker = new /datum/controller/gameticker() if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle() - datum/controller/game_controller/proc/setup() world.tick_lag = config.Ticklag + createRandomZlevel() + + if(!air_master) + air_master = new /datum/controller/air_system() + air_master.setup() + setup_objects() setupgenetics() setupfactions() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ec54cd00343..3d7a29a530e 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -47,7 +47,7 @@ var/mob/M = AM if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time - if(!M.restrained() && !M.small) + if(!M.restrained() && !M.small && !M.airflow_speed) bumpopen(M) return diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index 70ec7ddc36c..706e1716afd 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -7,12 +7,18 @@ /obj/effect/spawner/lootdrop/initialize() var/list/things = params2list(loot) + if(things && things.len) for(var/i = lootcount, i > 0, i--) - if(!things.len) return - var/lootspawn = text2path(pick(things)) - if(!lootdoubles) - things.Remove(lootspawn) + if(!things.len) + return - new lootspawn(get_turf(src)) + var/loot_spawn = pick(things) + var/loot_path = text2path(loot_spawn) + + if(!loot_path || !lootdoubles) + things.Remove(loot_spawn) + continue + + new loot_path(get_turf(src)) del(src) \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index 2efd352dcfd..60e465b19a4 100644 --- a/code/world.dm +++ b/code/world.dm @@ -78,14 +78,17 @@ src.update_status() + . = ..() + + sleep_offline = 1 + master_controller = new /datum/controller/game_controller() - spawn(-1) + spawn(1) master_controller.setup() lighting_controller.Initialize() process_teleport_locs() //Sets up the wizard teleport locations process_ghost_teleport_locs() //Sets up ghost teleport locations. - sleep_offline = 1 spawn(3000) //so we aren't adding to the round-start lag if(config.ToRban)