From e285ffd698be1e9d4ed52d94d7e7d35275c6ff5e Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Sun, 13 Oct 2013 10:35:15 -0400 Subject: [PATCH 1/4] Fixed respawn timer issues --- baystation12.int | 3 +++ code/modules/mob/dead/observer/observer.dm | 7 ++++--- code/modules/mob/new_player/new_player.dm | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/baystation12.int b/baystation12.int index 29f9e64646a..c5943eea55a 100644 --- a/baystation12.int +++ b/baystation12.int @@ -1,5 +1,8 @@ // BEGIN_INTERNALS /* +MAP_ICON_TYPE: 0 +LAST_COMPILE_VERSION: 500.1213 +LAST_COMPILE_TIME: 1381674628 AUTO_FILE_DIR: OFF */ // END_INTERNALS diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index e2789e446ab..f09204132bb 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -63,7 +63,7 @@ Works together with spawning an observer, noted above. if(key) var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc. ghost.can_reenter_corpse = can_reenter_corpse - ghost.timeofdeath = timeofdeath //BS12 EDIT + ghost.timeofdeath = src.timeofdeath //BS12 EDIT ghost.key = key return ghost @@ -78,10 +78,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(stat == DEAD) ghostize(1) else - var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst still alive you may not play again this round! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body") + var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another 30 minutes! You can't change your mind so choose wisely!)","Are you sure you want to ghost?","Ghost","Stay in body") if(response != "Ghost") return //didn't want to ghost after-all resting = 1 - ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 + var/mob/dead/observer/ghost = ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 + ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly. return diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 3ab083923c6..f884a308df4 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -119,6 +119,7 @@ var/obj/O = locate("landmark*Observer-Start") src << "\blue Now teleporting." observer.loc = O.loc + observer.timeofdeath = world.time // Set the time of death so that the respawn timer works correctly. if(client.prefs.be_random_name) client.prefs.real_name = random_name(client.prefs.gender) observer.real_name = client.prefs.real_name From b290a052ab3fae7a5694840edec3ac780c136482 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Sun, 13 Oct 2013 10:38:33 -0400 Subject: [PATCH 2/4] Undo changes to baystation12.int --- baystation12.int | 3 --- 1 file changed, 3 deletions(-) diff --git a/baystation12.int b/baystation12.int index c5943eea55a..29f9e64646a 100644 --- a/baystation12.int +++ b/baystation12.int @@ -1,8 +1,5 @@ // BEGIN_INTERNALS /* -MAP_ICON_TYPE: 0 -LAST_COMPILE_VERSION: 500.1213 -LAST_COMPILE_TIME: 1381674628 AUTO_FILE_DIR: OFF */ // END_INTERNALS From 24994ec75270800ced6653a2b0a9e5a8dd4b5dc3 Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Sun, 13 Oct 2013 19:44:12 +0100 Subject: [PATCH 3/4] Small work on making zones wake up on geometry changes. Also added sleeping for zones with unsimulated tiles; unfortunately it probably won't happen for ages due to a dichotomy paradox. Signed-off-by: Mloc-Argent --- code/ZAS/FEA_gas_mixture.dm | 12 ++++++++++++ code/ZAS/ZAS_Turfs.dm | 2 ++ code/ZAS/ZAS_Zones.dm | 30 +++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/code/ZAS/FEA_gas_mixture.dm b/code/ZAS/FEA_gas_mixture.dm index a4bdb022068..cea0efc3ab7 100644 --- a/code/ZAS/FEA_gas_mixture.dm +++ b/code/ZAS/FEA_gas_mixture.dm @@ -1007,6 +1007,18 @@ What are the archived variables for? return 0 return 1 +/datum/gas_mixture/proc/compare_unsim(turf/list/samples) + //Purpose: Compares a list of unsimulated tiles to self to see if within acceptable ranges that group processing may be enabled + //Called by: ZAS sleeping detection. + //Inputs: List of unsimulated turfs to compare to + //Outputs: 1 if within an acceptable range to sleep, 0 otherwise. + var/datum/gas_mixture/after_share = new + after_share.copy_from(src) + + ShareSpace(after_share, samples) + + return src.compare(after_share) + /datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side) //Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle //Called by: Pipelines ending in a break (or something) diff --git a/code/ZAS/ZAS_Turfs.dm b/code/ZAS/ZAS_Turfs.dm index 7ba40ef715a..12ac2df2445 100644 --- a/code/ZAS/ZAS_Turfs.dm +++ b/code/ZAS/ZAS_Turfs.dm @@ -179,6 +179,8 @@ if((air_check_directions & direction && !(air_directions_archived & direction)) || \ (unsim_check_directions & direction && !(unsim_directions_archived & direction))) ZConnect(src,T) + zone.ActivateIfNeeded() + if(T.zone) T.zone.ActivateIfNeeded() //Something like a wall was built, changing the geometry. else if((!(air_check_directions & direction) && air_directions_archived & direction) || \ diff --git a/code/ZAS/ZAS_Zones.dm b/code/ZAS/ZAS_Zones.dm index 371be846a9c..b58cdd1903a 100644 --- a/code/ZAS/ZAS_Zones.dm +++ b/code/ZAS/ZAS_Zones.dm @@ -21,6 +21,7 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs var/last_rebuilt = 0 var/status = ZONE_ACTIVE var/interactions_with_neighbors = 0 + var/interactions_with_unsim = 0 var/progress = "nothing" @@ -185,10 +186,14 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs unsimulated_tiles -= T if(unsimulated_tiles.len) + var/old_pressure = air.return_pressure() var/moved_air = ShareSpace(air,unsimulated_tiles) if(moved_air > vsc.airflow_lightest_pressure) AirflowSpace(src) + + if(old_pressure && (moved_air / old_pressure) > MINIMUM_AIR_RATIO_TO_SUSPEND) //Check if we've moved enough air to be considered awake. + interactions_with_unsim++ else unsimulated_tiles = null @@ -305,10 +310,11 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs Z.interactions_with_neighbors++ interactions_with_neighbors++ - if(!interactions_with_neighbors && !unsimulated_tiles) + if(!interactions_with_neighbors && !interactions_with_unsim) SetStatus(ZONE_SLEEPING) interactions_with_neighbors = 0 + interactions_with_unsim = 0 progress = "all components completed successfully, the problem is not here" @@ -329,6 +335,28 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs /zone/proc/CheckStatus() return status + +/zone/proc/ActivateIfNeeded() + if(status == ZONE_ACTIVE) return + + var/difference = 0 + + if(unsimulated_tiles && unsimulated_tiles.len) + if(air.compare_unsim(unsimulated_tiles)) + difference = 1 + + if(!difference) + for(var/zone/Z in connected_zones) //Check adjacent zones for air difference. + if(air.compare(Z.air)) + difference = 1 + break + + if(difference) //We have a difference, activate the zone. + SetStatus(ZONE_ACTIVE) + + return + + /zone/proc/assume_air(var/datum/gas_mixture/giver) if(status == ZONE_ACTIVE) return air.merge(giver) From 9af5c85c581e6857d48e6bd814644b69c01416d4 Mon Sep 17 00:00:00 2001 From: Aranclanos Date: Sun, 13 Oct 2013 17:11:39 -0300 Subject: [PATCH 4/4] Duplicates the speed of the gameticker! The emtiter beams were holding back the gameticker, 0.3 seconds per beam, now the sleep() is replaced with a spawn() instead. This will add lag due to everything being faster. --- code/modules/projectiles/projectile/beams.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index f513c83da33..3024ea1aa41 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -71,13 +71,13 @@ var/list/beam_master = list() ..() proc/cleanup(reference) //Waits .3 seconds then removes the overlay. - src = null - sleep(3) - var/list/turf_master = beam_master[reference] - for(var/laser_state in turf_master) - var/list/turfs = turf_master[laser_state] - for(var/turf/T in turfs) - T.overlays -= beam_master[laser_state] + src = null //we're getting deleted! this will keep the code running + spawn(3) + var/list/turf_master = beam_master[reference] + for(var/laser_state in turf_master) + var/list/turfs = turf_master[laser_state] + for(var/turf/T in turfs) + T.overlays -= beam_master[laser_state] return /obj/item/projectile/beam/practice