mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #7917 from VOREStation/Arokha/squeez
Attempt some performance improvements
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
#define AI_NORMAL 2 // Default level.
|
||||
#define AI_SMART 3 // Will do more processing to be a little smarter, like not walking while confused if it could risk stepping randomly onto a bad tile.
|
||||
|
||||
#define ai_log(M,V) if(debug_ai) ai_log_output(M,V)
|
||||
//#define ai_log(M,V) if(debug_ai) ai_log_output(M,V)
|
||||
#define ai_log(M,V)
|
||||
|
||||
// Logging level defines.
|
||||
#define AI_LOG_OFF 0 // Don't show anything.
|
||||
|
||||
@@ -318,9 +318,11 @@
|
||||
if(STANCE_MOVE)
|
||||
if(hostile && find_target()) // This will switch its stance.
|
||||
ai_log("handle_stance_strategical() : STANCE_MOVE, found target and was inturrupted.", AI_LOG_TRACE)
|
||||
return
|
||||
if(STANCE_FOLLOW)
|
||||
if(hostile && find_target()) // This will switch its stance.
|
||||
ai_log("handle_stance_strategical() : STANCE_FOLLOW, found target and was inturrupted.", AI_LOG_TRACE)
|
||||
return
|
||||
else if(leader)
|
||||
ai_log("handle_stance_strategical() : STANCE_FOLLOW, going to calculate_path([leader]).", AI_LOG_TRACE)
|
||||
calculate_path(leader)
|
||||
@@ -359,5 +361,6 @@
|
||||
if(ai_holder)
|
||||
ai_holder.receive_taunt(taunter, force_target_switch)
|
||||
|
||||
#undef AI_NO_PROCESS
|
||||
#undef AI_PROCESSING
|
||||
#undef AI_FASTPROCESSING
|
||||
@@ -6,7 +6,7 @@
|
||||
// If our holder is able to do anything.
|
||||
/datum/ai_holder/proc/can_act()
|
||||
if(!holder) // Holder missing.
|
||||
manage_processing(AI_NO_PROCESS)
|
||||
manage_processing(0)
|
||||
return FALSE
|
||||
if(holder.stat) // Dead or unconscious.
|
||||
ai_log("can_act() : Stat was non-zero ([holder.stat]).", AI_LOG_TRACE)
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
/obj/item/integrated_circuit/output/text_to_speech/advanced/Initialize()
|
||||
..()
|
||||
my_voice = new (src)
|
||||
mob_list -= my_voice // no life() ticks
|
||||
my_voice.name = "TTS Circuit"
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech/advanced/do_work()
|
||||
|
||||
@@ -3,11 +3,22 @@
|
||||
status_flags = GODMODE|CANPUSH
|
||||
has_huds = FALSE
|
||||
|
||||
/mob/living/carbon/human/dummy/mannequin/Initialize()
|
||||
/mob/living/carbon/human/dummy/Initialize()
|
||||
. = ..()
|
||||
mob_list -= src
|
||||
living_mob_list -= src
|
||||
dead_mob_list -= src
|
||||
human_mob_list -= src
|
||||
|
||||
/mob/living/carbon/human/dummy/Life()
|
||||
mob_list -= src
|
||||
living_mob_list -= src
|
||||
dead_mob_list -= src
|
||||
human_mob_list -= src
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/dummy/mannequin/Initialize()
|
||||
. = ..()
|
||||
delete_inventory()
|
||||
|
||||
/mob/living/carbon/human/skrell/Initialize(var/new_loc)
|
||||
|
||||
@@ -985,9 +985,15 @@ var/list/ai_verbs_default = list(
|
||||
dead_mob_list -= src
|
||||
ai_list -= src
|
||||
silicon_mob_list -= src
|
||||
QDEL_NULL(eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/announcer/Life()
|
||||
return
|
||||
mob_list -= src
|
||||
living_mob_list -= src
|
||||
dead_mob_list -= src
|
||||
ai_list -= src
|
||||
silicon_mob_list -= src
|
||||
QDEL_NULL(eyeobj)
|
||||
|
||||
#undef AI_CHECK_WIRELESS
|
||||
#undef AI_CHECK_RADIO
|
||||
|
||||
@@ -156,6 +156,9 @@
|
||||
// contained in a cage
|
||||
var/in_stasis = 0
|
||||
|
||||
// don't process me if there's nobody around to see it
|
||||
low_priority = TRUE
|
||||
|
||||
/mob/living/simple_mob/Initialize()
|
||||
verbs -= /mob/verb/observe
|
||||
health = maxHealth
|
||||
|
||||
@@ -1200,6 +1200,16 @@ mob/proc/yank_out_object()
|
||||
else
|
||||
registered_z = null
|
||||
|
||||
GLOBAL_LIST_EMPTY(living_players_by_zlevel)
|
||||
/mob/living/update_client_z(new_z)
|
||||
var/precall_reg_z = registered_z
|
||||
. = ..() // will update registered_z if necessary
|
||||
if(precall_reg_z != registered_z) // parent did work, let's do work too
|
||||
if(precall_reg_z)
|
||||
GLOB.living_players_by_zlevel[precall_reg_z] -= src
|
||||
if(registered_z)
|
||||
GLOB.living_players_by_zlevel[registered_z] += src
|
||||
|
||||
/mob/onTransitZ(old_z, new_z)
|
||||
..()
|
||||
update_client_z(new_z)
|
||||
|
||||
Reference in New Issue
Block a user