Merge remote-tracking branch 'upstream/dev' into 150722-TagPairs

Conflicts:
	code/game/gamemodes/changeling/modularchangling.dm
This commit is contained in:
PsiOmegaDelta
2015-08-13 08:09:28 +02:00
319 changed files with 5837 additions and 4354 deletions

View File

@@ -28,6 +28,10 @@ var/list/delayed_garbage = list()
delayed_garbage.Cut()
delayed_garbage = null
#ifdef GC_FINDREF
world/loop_checks = 0
#endif
/datum/controller/process/garbage_collector/doWork()
if(!garbage_collect)
return
@@ -37,6 +41,31 @@ var/list/delayed_garbage = list()
var/checkRemain = max_checks_multiplier * schedule_interval
var/maxDels = max_forcedel_multiplier * schedule_interval
#ifdef GC_FINDREF
var/list/searching = list()
for(var/refID in destroyed) // Reference search - before all deletions and for all at once
var/GCd_at_time = destroyed[refID]
if(GCd_at_time > time_to_kill)
break
var/atom/A = locate(refID)
if(A && A.gcDestroyed == GCd_at_time)
searching += A
if(searching.len >= checkRemain)
break
for(var/atom/A in searching)
testing("GC: Searching references for [A] | [A.type]")
if(A.loc != null)
testing("GC: [A] | [A.type] is located in [A.loc] instead of null")
if(A.contents.len)
testing("GC: [A] | [A.type] has contents: [list2text(A.contents)]")
if(searching.len)
for(var/atom/D in world)
LookForRefs(D, searching)
for(var/datum/D)
LookForRefs(D, searching)
#endif
while(destroyed.len && --checkRemain >= 0)
if(dels >= maxDels)
#ifdef GC_DEBUG
@@ -50,7 +79,7 @@ var/list/delayed_garbage = list()
testing("GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + collection_timeout]")
#endif
break // Everything else is newer, skip them
var/atom/A = locate(refID)
var/datum/A = locate(refID)
#ifdef GC_DEBUG
testing("GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]")
#endif
@@ -67,6 +96,32 @@ var/list/delayed_garbage = list()
#endif
destroyed.Cut(1, 2)
#ifdef GC_FINDREF
/datum/controller/process/garbage_collector/proc/LookForRefs(var/datum/D, var/list/targ)
. = 0
for(var/V in D.vars)
if(V == "contents")
continue
if(istype(D.vars[V], /atom))
var/atom/A = D.vars[V]
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], var [V]")
. += 1
else if(islist(D.vars[V]))
. += LookForListRefs(D.vars[V], targ, D, V)
/datum/controller/process/garbage_collector/proc/LookForListRefs(var/list/L, var/list/targ, var/datum/D, var/V)
. = 0
for(var/F in L)
if(istype(F, /atom))
var/atom/A = F
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], list [V]")
. += 1
if(islist(F))
. += LookForListRefs(F, targ, D, "[F] in list [V]")
#endif
/datum/controller/process/garbage_collector/proc/AddTrash(datum/A)
if(!istype(A) || !isnull(A.gcDestroyed))
return
@@ -199,3 +254,7 @@ var/list/delayed_garbage = list()
#ifdef GC_DEBUG
#undef GC_DEBUG
#endif
#ifdef GC_FINDREF
#undef GC_FINDREF
#endif

View File

@@ -121,6 +121,8 @@ var/list/gamemode_cache = list()
var/organ_health_multiplier = 1
var/organ_regeneration_multiplier = 1
var/organs_decay
var/default_brain_health = 400
//Paincrit knocks someone down once they hit 60 shock_stage, so by default make it so that close to 100 additional damage needs to be dealt,
//so that it's similar to HALLOSS. Lowered it a bit since hitting paincrit takes much longer to wear off than a halloss stun.
@@ -709,6 +711,12 @@ var/list/gamemode_cache = list()
config.organ_regeneration_multiplier = value / 100
if("organ_damage_spillover_multiplier")
config.organ_damage_spillover_multiplier = value / 100
if("organs_can_decay")
config.organs_decay = 1
if("default_brain_health")
config.default_brain_health = text2num(value)
if(!config.default_brain_health || config.default_brain_health < 1)
config.default_brain_health = initial(config.default_brain_health)
if("bones_can_break")
config.bones_can_break = value
if("limbs_can_break")

View File

@@ -49,6 +49,11 @@ datum/controller/game_controller/proc/setup_objects()
for(var/atom/movable/object in world)
object.initialize()
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
sleep(-1)
for(var/area/area in all_areas)
area.initialize()
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)

View File

@@ -188,9 +188,9 @@ datum/controller/vote
if(mode)
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
return 0
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
if(vote && 1<=vote && vote<=choices.len)
if(vote && vote >= 1 && vote <= choices.len)
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
voted += usr.ckey
choices[choices[vote]]++ //check this
current_votes[ckey] = vote