From b5430eb68c37487ee2e8ef3ccd41e02e228bdb0e Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 14:39:19 -0700 Subject: [PATCH] fuck --- .../mob/living/carbon/human/species.dm | 11 +-------- code/modules/movespeed/_movespeed_modifier.dm | 23 ++----------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 3987f64b745..e80dc5d94c7 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1712,19 +1712,10 @@ GLOBAL_LIST_EMPTY(roundstart_races) // clear any hot moods and apply cold mood SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot") SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold) -<<<<<<< HEAD - //Sorry for the nasty oneline but I don't want to assign a variable on something run pretty frequently - H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/cold, multiplicative_slowdown = ((BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR)) -======= - // Apply cold slow down - H.add_movespeed_modifier(MOVESPEED_ID_COLD, override = TRUE, \ - multiplicative_slowdown = ((bodytemp_cold_damage_limit - H.bodytemperature) / COLD_SLOWDOWN_FACTOR), \ - blacklisted_movetypes = FLOATING) - + H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/cold, multiplicative_slowdown = ((bodytemp_cold_damage_limit - H.bodytemperature) / COLD_SLOWDOWN_FACTOR)) // Display alerts based on the amount of cold damage being taken // Apply more damage based on how cold you are ->>>>>>> tgstation/master switch(H.bodytemperature) if(200 to bodytemp_cold_damage_limit) H.throw_alert("temp", /obj/screen/alert/cold, 1) diff --git a/code/modules/movespeed/_movespeed_modifier.dm b/code/modules/movespeed/_movespeed_modifier.dm index a2f706f231c..5410ce2ac7c 100644 --- a/code/modules/movespeed/_movespeed_modifier.dm +++ b/code/modules/movespeed/_movespeed_modifier.dm @@ -84,27 +84,8 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) if(existing == type_or_datum) //same thing don't need to touch return TRUE remove_movespeed_modifier(existing, FALSE) - LAZYINITLIST(movespeed_modification) - var/listlen = length(movespeed_modification) - if(!listlen) - movespeed_modification[type_or_datum.id] = type_or_datum - else - var/left = 1 - var/right = listlen - var/mid = (left + right) >> 1 - var/datum/movespeed_modifier/curr - while(left < right) - var/id = movespeed_modification[mid] - curr = movespeed_modification[id] - if(curr.priority <= type_or_datum.priority) - left = mid + 1 - else - right = mid - mid = (left + right) >> 1 - curr = movespeed_modification[mid] - mid = curr.priority > type_or_datum.priority? mid : mid + 1 - movespeed_modification.Insert(mid, type_or_datum.id) - movespeed_modification[type_or_datum.id] = type_or_datum + if(length(movespeed_modification)) + BINARY_INSERT(type_or_datum.id, movespeed_modification, datum/movespeed_modifier, type_or_datum, priority, __BIN_LIST[__BIN_LIST[__BIN_MID]]) LAZYSET(movespeed_modification, type_or_datum.id, type_or_datum) if(update) update_movespeed()