Fixed a bunch of warnings and errors (#26993)

* renamed implant malfunction defines

* refactored domutation

* possibly fix something about whitelists

* fix admin_memo warning

* fixed wrong attackby parameters in click.dm

* remove superfluous return in BSQL

* maybe fix something in mob/add_language

* maybe fix more language stuff

* Added return-type annotation to job_controller

* removed unreachable code from observer.dm

* possibly fix electrocute_act

* fixed bees wow this code never ran, 100% tested

* fixed parrot life

* fixed wolf attack logs

* fix bear life

* removed unreachable slime/show_inv

* fixed human/electrocute_act

* actually just get rid of this shit

* properly add return types

* removed more returns from BSQL

* added get_organ return type

* fixed infrared holder_movement

* fixed type_instances declaration

* fixed unreacheable overlay/New

* possibly fix release_restraints

* remove hopefully final return from BSQL
This commit is contained in:
DamianX
2020-07-01 14:46:00 +02:00
committed by GitHub
parent 2ffc595a3d
commit 85ff9b697a
26 changed files with 50 additions and 80 deletions

View File

@@ -46,7 +46,7 @@ var/global/list/deadmins = list()
var/list/lockedvars = list("vars", "client", "holder", "step_x", "step_y", "step_size") var/list/lockedvars = list("vars", "client", "holder", "step_x", "step_y", "step_size")
// List of types and how many instances of each type there are. // List of types and how many instances of each type there are.
var/global/list/type_instances[0] var/list/type_instances
/var/global/datum/map/active/map = new() //Current loaded map /var/global/datum/map/active/map = new() //Current loaded map
//Defined in its .dm, see maps/_map.dm for more info. //Defined in its .dm, see maps/_map.dm for more info.

2
__DEFINES/implants.dm Normal file
View File

@@ -0,0 +1,2 @@
#define IMPLANT_MALFUNCTION_TEMPORARY 1
#define IMPLANT_MALFUNCTION_PERMANENT 2

View File

@@ -8,6 +8,7 @@
return null return null
/proc/get_area(const/atom/O) /proc/get_area(const/atom/O)
RETURN_TYPE(/area)
if(isarea(O)) if(isarea(O))
return O return O
var/turf/T = get_turf(O) var/turf/T = get_turf(O)

View File

@@ -143,13 +143,7 @@
item_attack_delay = held_item.attack_delay item_attack_delay = held_item.attack_delay
var/resolved = held_item.preattack(A, src, 1, params) var/resolved = held_item.preattack(A, src, 1, params)
if(!resolved) if(!resolved)
if(ismob(A) && modifiers["def_zone"]) resolved = A.attackby(held_item, src, params)
var/mob/M = A
var/def_zone
def_zone = modifiers["def_zone"]
resolved = M.attackby(held_item,src,def_zone = def_zone, params)
else
resolved = A.attackby(held_item, src, params)
if((ismob(A) || istype(A, /obj/mecha) || istype(held_item, /obj/item/weapon/grab)) && !A.gcDestroyed) if((ismob(A) || istype(A, /obj/mecha) || istype(held_item, /obj/item/weapon/grab)) && !A.gcDestroyed)
delayNextAttack(item_attack_delay) delayNextAttack(item_attack_delay)
if(!resolved && A && !A.gcDestroyed && held_item) if(!resolved && A && !A.gcDestroyed && held_item)

View File

@@ -675,9 +675,8 @@
/atom/movable/overlay/New() /atom/movable/overlay/New()
. = ..() . = ..()
if(!loc) if(!loc)
CRASH("[type] created in nullspace.")
qdel(src) qdel(src)
return CRASH("[type] created in nullspace.")
master = loc master = loc
name = master.name name = master.name

View File

@@ -104,7 +104,9 @@
//testing("[gene.name] deactivated!") //testing("[gene.name] deactivated!")
var/tempflag = flags var/tempflag = flags
if(ishuman(M)) if(ishuman(M))
tempflag |= (((ishuman(M) && M:species) && gene.block in M:species:default_blocks) ? 4 : 0) var/mob/living/carbon/human/dude = M
if(gene.block in dude.species?.default_blocks)
tempflag |= GENE_NATURAL
gene.deactivate(M,connected,tempflag) gene.deactivate(M,connected,tempflag)
if(M) if(M)
//testing("Removing [gene.name]([gene.type]) from activegenes") //testing("Removing [gene.name]([gene.type]) from activegenes")
@@ -128,4 +130,4 @@
C.mind.transfer_to(V) C.mind.transfer_to(V)
qdel(C) qdel(C)
*/ */

View File

@@ -48,8 +48,8 @@ var/global/datum/controller/occupations/job_master
job_debug.Add(text) job_debug.Add(text)
return 1 return 1
/datum/controller/occupations/proc/GetJob(var/rank) /datum/controller/occupations/proc/GetJob(var/rank)
RETURN_TYPE(/datum/job)
if(!rank) if(!rank)
return null return null
for(var/datum/job/J in occupations) for(var/datum/job/J in occupations)

View File

@@ -75,7 +75,7 @@ var/global/list/alien_whitelist = list()
// Occupation is in whitelist (for lizard janitors :V) // Occupation is in whitelist (for lizard janitors :V)
if("job=[lowertext(M.mind.assigned_role)]" in alien_whitelist[species]\ if("job=[lowertext(M.mind.assigned_role)]" in alien_whitelist[species]\
|| "job=[lowertext(M.mind.assigned_role)]" in alien_whitelist["all"]) ||("job=[lowertext(M.mind.assigned_role)]" in alien_whitelist["all"]))
return 1 return 1
return 0 return 0
@@ -86,4 +86,4 @@ var/global/list/alien_whitelist = list()
species=lowertext(species) species=lowertext(species)
return species in alien_whitelist return species in alien_whitelist
#undef WHITELISTFILE #undef WHITELISTFILE

View File

@@ -1,5 +1,3 @@
#define MALFUNCTION_TEMPORARY 1
#define MALFUNCTION_PERMANENT 2
/obj/item/weapon/implant /obj/item/weapon/implant
name = "implant" name = "implant"
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'
@@ -46,7 +44,7 @@
name = "melted implant" name = "melted implant"
desc = "Charred circuit in melted plastic case. Wonder what that used to be..." desc = "Charred circuit in melted plastic case. Wonder what that used to be..."
icon_state = "implant_melted" icon_state = "implant_melted"
malfunction = MALFUNCTION_PERMANENT malfunction = IMPLANT_MALFUNCTION_PERMANENT
/obj/item/weapon/implant/Destroy() /obj/item/weapon/implant/Destroy()
if(part) if(part)
@@ -91,7 +89,7 @@
activate() activate()
/obj/item/weapon/implant/explosive/activate() /obj/item/weapon/implant/explosive/activate()
if(malfunction == MALFUNCTION_PERMANENT) if(malfunction == IMPLANT_MALFUNCTION_PERMANENT)
return return
if(iscarbon(imp_in)) if(iscarbon(imp_in))
var/mob/M = imp_in var/mob/M = imp_in
@@ -119,7 +117,7 @@
/obj/item/weapon/implant/explosive/emp_act(severity) /obj/item/weapon/implant/explosive/emp_act(severity)
if(malfunction) if(malfunction)
return return
malfunction = MALFUNCTION_TEMPORARY malfunction = IMPLANT_MALFUNCTION_TEMPORARY
switch (severity) switch (severity)
if(2.0) //Weak EMP will make implant tear limbs off. if(2.0) //Weak EMP will make implant tear limbs off.
if(prob(50)) if(prob(50))
@@ -213,7 +211,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
/obj/item/weapon/implant/chem/emp_act(severity) /obj/item/weapon/implant/chem/emp_act(severity)
if (malfunction) if (malfunction)
return return
malfunction = MALFUNCTION_TEMPORARY malfunction = IMPLANT_MALFUNCTION_TEMPORARY
switch(severity) switch(severity)
if(1) if(1)
@@ -436,14 +434,14 @@ the implant may become unstable and either pre-maturely inject the subject or si
/obj/item/weapon/implant/death_alarm/emp_act(severity) //for some reason alarms stop going off in case they are emp'd, even without this /obj/item/weapon/implant/death_alarm/emp_act(severity) //for some reason alarms stop going off in case they are emp'd, even without this
if (malfunction) //so I'm just going to add a meltdown chance here if (malfunction) //so I'm just going to add a meltdown chance here
return return
malfunction = MALFUNCTION_TEMPORARY malfunction = IMPLANT_MALFUNCTION_TEMPORARY
activate("emp") //let's shout that this dude is dead activate("emp") //let's shout that this dude is dead
if(severity == 1) if(severity == 1)
if(prob(40)) //small chance of obvious meltdown if(prob(40)) //small chance of obvious meltdown
meltdown() meltdown()
else //but more likely it will just quietly die else //but more likely it will just quietly die
malfunction = MALFUNCTION_PERMANENT malfunction = IMPLANT_MALFUNCTION_PERMANENT
processing_objects.Remove(src) processing_objects.Remove(src)
return return
@@ -530,15 +528,15 @@ the implant may become unstable and either pre-maturely inject the subject or si
name = "denatured implant" name = "denatured implant"
desc = "A dead, hollow implant. Wonder what it used to be..." desc = "A dead, hollow implant. Wonder what it used to be..."
icon_state = "implant_melted" icon_state = "implant_melted"
malfunction = MALFUNCTION_PERMANENT malfunction = IMPLANT_MALFUNCTION_PERMANENT
/obj/item/weapon/implant/peace/process() /obj/item/weapon/implant/peace/process()
var/mob/living/carbon/host = imp_in var/mob/living/carbon/host = imp_in
if (isnull(host) && imp_alive) if (isnull(host) && imp_alive)
malfunction = MALFUNCTION_PERMANENT malfunction = IMPLANT_MALFUNCTION_PERMANENT
if (malfunction == MALFUNCTION_PERMANENT) if (malfunction == IMPLANT_MALFUNCTION_PERMANENT)
meltdown() meltdown()
processing_objects.Remove(src) processing_objects.Remove(src)
return return
@@ -547,11 +545,11 @@ the implant may become unstable and either pre-maturely inject the subject or si
imp_alive = 1 imp_alive = 1
if (host.nutrition <= 0 || host.reagents.has_reagent(METHYLIN, 15)) if (host.nutrition <= 0 || host.reagents.has_reagent(METHYLIN, 15))
malfunction = MALFUNCTION_TEMPORARY malfunction = IMPLANT_MALFUNCTION_TEMPORARY
else else
malfunction = 0 malfunction = 0
if (!imp_msg_debounce && malfunction == MALFUNCTION_TEMPORARY) if (!imp_msg_debounce && malfunction == IMPLANT_MALFUNCTION_TEMPORARY)
imp_msg_debounce = 1 imp_msg_debounce = 1
to_chat(host, "<span class = 'warning'>Your rage bubbles, \the [src] inside you is being suppressed!</span>") to_chat(host, "<span class = 'warning'>Your rage bubbles, \the [src] inside you is being suppressed!</span>")

View File

@@ -1,6 +1,3 @@
#define MALFUNCTION_TEMPORARY 1
#define MALFUNCTION_PERMANENT 2
/obj/item/weapon/implant/tracking /obj/item/weapon/implant/tracking
name = "tracking implant" name = "tracking implant"
desc = "Track with this." desc = "Track with this."
@@ -34,7 +31,7 @@ Implant Specifics:<BR>"}
/obj/item/weapon/implant/tracking/emp_act(severity) /obj/item/weapon/implant/tracking/emp_act(severity)
if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning
return return
malfunction = MALFUNCTION_TEMPORARY malfunction = IMPLANT_MALFUNCTION_TEMPORARY
var/delay = 20 var/delay = 20
switch(severity) switch(severity)
@@ -174,11 +171,11 @@ var/list/locator_holomap_cache = list()
continue continue
if(TU.z != T.z) if(TU.z != T.z)
continue continue
if (implant.malfunction == MALFUNCTION_PERMANENT) if (implant.malfunction == IMPLANT_MALFUNCTION_PERMANENT)
continue continue
var/mob/M var/mob/M
var/marker_state = "tracker" var/marker_state = "tracker"
if (implant.malfunction == MALFUNCTION_TEMPORARY) if (implant.malfunction == IMPLANT_MALFUNCTION_TEMPORARY)
marker_state = "tracker-malfunction" marker_state = "tracker-malfunction"
if (implant.loc != implant.imp_in) if (implant.loc != implant.imp_in)
marker_state = "tracker-dead" marker_state = "tracker-dead"
@@ -290,6 +287,3 @@ var/list/locator_holomap_cache = list()
legend.pixel_x = 7*WORLD_ICON_SIZE legend.pixel_x = 7*WORLD_ICON_SIZE
legend.pixel_y = 7*WORLD_ICON_SIZE legend.pixel_y = 7*WORLD_ICON_SIZE
station_map.overlays += legend station_map.overlays += legend
#undef MALFUNCTION_TEMPORARY
#undef MALFUNCTION_PERMANENT

View File

@@ -19,7 +19,6 @@ BSQL_PROTECT_DATUM(/datum/BSQL_Connection)
var/error = world._BSQL_Internal_Call("CreateConnection", connection_type, "[asyncTimeout]", "[blockingTimeout]", "[threadLimit]") var/error = world._BSQL_Internal_Call("CreateConnection", connection_type, "[asyncTimeout]", "[blockingTimeout]", "[threadLimit]")
if(error) if(error)
BSQL_ERROR(error) BSQL_ERROR(error)
return
id = world._BSQL_Internal_Call("GetConnection") id = world._BSQL_Internal_Call("GetConnection")
if(!id) if(!id)
@@ -37,12 +36,10 @@ BSQL_DEL_PROC(/datum/BSQL_Connection)
var/error = world._BSQL_Internal_Call("OpenConnection", id, ipaddress, "[port]", username, password, database) var/error = world._BSQL_Internal_Call("OpenConnection", id, ipaddress, "[port]", username, password, database)
if(error) if(error)
BSQL_ERROR(error) BSQL_ERROR(error)
return
var/op_id = world._BSQL_Internal_Call("GetOperation") var/op_id = world._BSQL_Internal_Call("GetOperation")
if(!op_id) if(!op_id)
BSQL_ERROR("Library failed to provide connect operation for connection id [id]([connection_type])!") BSQL_ERROR("Library failed to provide connect operation for connection id [id]([connection_type])!")
return
return new /datum/BSQL_Operation(src, op_id) return new /datum/BSQL_Operation(src, op_id)
@@ -51,18 +48,16 @@ BSQL_DEL_PROC(/datum/BSQL_Connection)
var/error = world._BSQL_Internal_Call("NewQuery", id, query) var/error = world._BSQL_Internal_Call("NewQuery", id, query)
if(error) if(error)
BSQL_ERROR(error) BSQL_ERROR(error)
return
var/op_id = world._BSQL_Internal_Call("GetOperation") var/op_id = world._BSQL_Internal_Call("GetOperation")
if(!op_id) if(!op_id)
BSQL_ERROR("Library failed to provide query operation for connection id [id]([connection_type])!") BSQL_ERROR("Library failed to provide query operation for connection id [id]([connection_type])!")
return
return new /datum/BSQL_Operation/Query(src, op_id) return new /datum/BSQL_Operation/Query(src, op_id)
/datum/BSQL_Connection/Quote(str) /datum/BSQL_Connection/Quote(str)
if(!str) if(!str)
return null; return null;
. = world._BSQL_Internal_Call("QuoteString", id, "[str]") . = world._BSQL_Internal_Call("QuoteString", id, "[str]")
if(!.) if(!.)
BSQL_ERROR("Library failed to provide quote for [str]!") BSQL_ERROR("Library failed to provide quote for [str]!")

View File

@@ -15,19 +15,16 @@
if(!fexists(libPath)) if(!fexists(libPath))
BSQL_DEL_CALL(caller) BSQL_DEL_CALL(caller)
BSQL_ERROR("Could not find [libPath]!") BSQL_ERROR("Could not find [libPath]!")
return
var/version = _BSQL_Internal_Call("Version") var/version = _BSQL_Internal_Call("Version")
if(version != BSQL_VERSION) if(version != BSQL_VERSION)
BSQL_DEL_CALL(caller) BSQL_DEL_CALL(caller)
BSQL_ERROR("BSQL DMAPI version mismatch! Expected [BSQL_VERSION], got [version == null ? "NULL" : version]!") BSQL_ERROR("BSQL DMAPI version mismatch! Expected [BSQL_VERSION], got [version == null ? "NULL" : version]!")
return
var/result = _BSQL_Internal_Call("Initialize") var/result = _BSQL_Internal_Call("Initialize")
if(result) if(result)
BSQL_DEL_CALL(caller) BSQL_DEL_CALL(caller)
BSQL_ERROR(result) BSQL_ERROR(result)
return
_BSQL_Initialized(TRUE) _BSQL_Initialized(TRUE)
/world/proc/_BSQL_Initialized(new_val) /world/proc/_BSQL_Initialized(new_val)

View File

@@ -22,7 +22,6 @@ BSQL_DEL_PROC(/datum/BSQL_Operation)
var/result = world._BSQL_Internal_Call("OpComplete", connection.id, id) var/result = world._BSQL_Internal_Call("OpComplete", connection.id, id)
if(!result) if(!result)
BSQL_ERROR("Error fetching operation [id] for connection [connection.id]!") BSQL_ERROR("Error fetching operation [id] for connection [connection.id]!")
return
return result == "DONE" return result == "DONE"
/datum/BSQL_Operation/GetError() /datum/BSQL_Operation/GetError()
@@ -43,5 +42,4 @@ BSQL_DEL_PROC(/datum/BSQL_Operation)
if(error == "Operation timed out!") //match this with the implementation if(error == "Operation timed out!") //match this with the implementation
return FALSE return FALSE
BSQL_ERROR("Error waiting for operation [id] for connection [connection.id]! [error]") BSQL_ERROR("Error waiting for operation [id] for connection [connection.id]! [error]")
return
return TRUE return TRUE

View File

@@ -5,8 +5,9 @@
/client/proc/admin_memo(task in list("write","show","delete")) /client/proc/admin_memo(task in list("write","show","delete"))
set name = "Memo" set name = "Memo"
set category = "Server" set category = "Server"
if(!ENABLE_MEMOS) #if !ENABLE_MEMOS
return return
#endif
if(!check_rights(0)) if(!check_rights(0))
return return
switch(task) switch(task)

View File

@@ -131,8 +131,8 @@
/obj/item/device/assembly/infra/holder_movement() /obj/item/device/assembly/infra/holder_movement()
if(!holder) if(!holder)
return 0 return 0
dir = holder.dir dir = holder.dir
holder.update_icon() holder.update_icon()
if (beam) if (beam)
returnToPool(beam) returnToPool(beam)
beam = null beam = null

View File

@@ -272,7 +272,6 @@ Works together with spawning an observer, noted above.
return "health0" return "health0"
else else
return "health-100" return "health-100"
return "0"
// Pretty much a direct copy of Medical HUD stuff, except will show ill if they are ill instead of also checking for known illnesses. // Pretty much a direct copy of Medical HUD stuff, except will show ill if they are ill instead of also checking for known illnesses.
/mob/dead/proc/process_medHUD(var/mob/M) /mob/dead/proc/process_medHUD(var/mob/M)

View File

@@ -310,7 +310,7 @@
var/datum/language/new_language = all_languages[language] var/datum/language/new_language = all_languages[language]
if(!istype(new_language) || new_language in languages) if(!istype(new_language) || (new_language in languages))
return 0 return 0
languages.Add(new_language) languages.Add(new_language)
@@ -332,9 +332,7 @@
// Can we speak this language, as opposed to just understanding it? // Can we speak this language, as opposed to just understanding it?
/mob/proc/can_speak_lang(datum/language/speaking) /mob/proc/can_speak_lang(datum/language/speaking)
return (universal_speak || (speaking in src.languages))
return (universal_speak || speaking in src.languages)
//TBD //TBD
/mob/verb/check_languages() /mob/verb/check_languages()

View File

@@ -411,7 +411,7 @@
//Removed the horrible safety parameter. It was only being used by ninja code anyways. //Removed the horrible safety parameter. It was only being used by ninja code anyways.
//Now checks siemens_coefficient of the affected area by default //Now checks siemens_coefficient of the affected area by default
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null, var/incapacitation_duration) /mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null, var/incapacitation_duration)
if(status_flags & GODMODE || M_NO_SHOCK in src.mutations) if(status_flags & GODMODE || (M_NO_SHOCK in src.mutations))
return 0 //godmode return 0 //godmode
if (!def_zone) if (!def_zone)

View File

@@ -467,16 +467,6 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
/mob/living/carbon/slime/show_inv(mob/user) /mob/living/carbon/slime/show_inv(mob/user)
return return
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR><BR>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[name];size=340x480"))
onclose(user, "mob[name]")
return
/mob/living/carbon/slime/updatehealth() /mob/living/carbon/slime/updatehealth()
if(status_flags & GODMODE) if(status_flags & GODMODE)
health = maxHealth health = maxHealth

View File

@@ -445,7 +445,7 @@
return L return L
/mob/living/proc/electrocute_act(const/shock_damage, const/obj/source, const/siemens_coeff = 1.0) /mob/living/proc/electrocute_act(const/shock_damage, const/obj/source, const/siemens_coeff = 1.0)
if(status_flags & GODMODE || M_NO_SHOCK in src.mutations) if(status_flags & GODMODE || (M_NO_SHOCK in src.mutations))
return 0 return 0
var/damage = shock_damage * siemens_coeff var/damage = shock_damage * siemens_coeff
@@ -473,6 +473,7 @@
..() ..()
/mob/living/proc/get_organ(zone) /mob/living/proc/get_organ(zone)
RETURN_TYPE(/datum/organ/external)
return return
//A proc that turns organ strings into a list of organ datums //A proc that turns organ strings into a list of organ datums

View File

@@ -442,7 +442,7 @@ var/bee_mobs_count = 0
step_rand(B_mob) step_rand(B_mob)
//ATTACKING TARGET //ATTACKING TARGET
else if(state == BEE_OUT_FOR_ENEMIES && M in view(src,1)) else if(state == BEE_OUT_FOR_ENEMIES && (M in view(src,1)))
var/sting_prob = 100 var/sting_prob = 100
if(istype(M)) if(istype(M))
var/obj/item/clothing/worn_suit = M.wear_suit var/obj/item/clothing/worn_suit = M.wear_suit
@@ -600,7 +600,7 @@ var/bee_mobs_count = 0
//REACHING FOR FLOWERS //REACHING FOR FLOWERS
if(state == BEE_OUT_FOR_PLANTS && pollinating <= 0) if(state == BEE_OUT_FOR_PLANTS && pollinating <= 0)
var/turf/target_turf = null var/turf/target_turf = null
if(target_plant && target_plant in view(src,7)) if(target_plant && (target_plant in view(src,7)))
target_turf = get_turf(target_plant) target_turf = get_turf(target_plant)
wander = 0 wander = 0
else else

View File

@@ -122,7 +122,7 @@
stop_automated_movement = 1 stop_automated_movement = 1
stance_step++ stance_step++
if(stance_step >= 10) //rests for 10 ticks if(stance_step >= 10) //rests for 10 ticks
if(target && target in ListTargets()) if(target && (target in ListTargets()))
stance = HOSTILE_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle. stance = HOSTILE_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
else else
stance = HOSTILE_STANCE_IDLE stance = HOSTILE_STANCE_IDLE
@@ -130,7 +130,7 @@
if(HOSTILE_STANCE_ALERT) if(HOSTILE_STANCE_ALERT)
stop_automated_movement = 1 stop_automated_movement = 1
var/found_mob = 0 var/found_mob = 0
if(target && target in ListTargets()) if(target && (target in ListTargets()))
if(CanAttack(target)) if(CanAttack(target))
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again. stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
stance_step++ stance_step++
@@ -192,4 +192,4 @@
..(5) ..(5)
/mob/living/simple_animal/hostile/bear/attack_icon() /mob/living/simple_animal/hostile/bear/attack_icon()
return image(icon = 'icons/mob/attackanims.dmi', icon_state = "bear") return image(icon = 'icons/mob/attackanims.dmi', icon_state = "bear")

View File

@@ -389,8 +389,8 @@
stance = HOSTILE_STANCE_ATTACK stance = HOSTILE_STANCE_ATTACK
alpha_stance = WOLF_ALPHAATTACK alpha_stance = WOLF_ALPHAATTACK
alpha_target = target alpha_target = target
add_attacklogs(pack_alpha, target, "set [src] (wolf) on") add_attacklogs(pack_alpha, target, "set [src] (wolf) on", admin_warn = TRUE)
log_admin("[key_name(pack_alpha)] has ordered a wolf named \[src] to attack [key_name(target)] @([src.x], [src.y], [src.z])", admin_warn = TRUE) log_admin("[key_name(pack_alpha)] has ordered a wolf named \[src] to attack [key_name(target)] @([src.x], [src.y], [src.z])")
if(istype (target, /turf)) //We go! if(istype (target, /turf)) //We go!
alpha_stance = WOLF_ALPHAMOVE alpha_stance = WOLF_ALPHAMOVE
alpha_target = target alpha_target = target

View File

@@ -494,11 +494,11 @@
return return
return return
if(parrot_interest && parrot_interest in view(src)) if(parrot_interest && (parrot_interest in view(src)))
parrot_state = PARROT_SWOOP | PARROT_STEAL parrot_state = PARROT_SWOOP | PARROT_STEAL
return return
if(parrot_perch && parrot_perch in view(src)) if(parrot_perch && (parrot_perch in view(src)))
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return

View File

@@ -917,7 +917,7 @@ Note that amputating the affected organ does in fact remove the infection from t
owner.drop_from_inventory(owner.handcuffed) owner.drop_from_inventory(owner.handcuffed)
if(uncuff <= UNCUFF_BOTH) if(uncuff <= UNCUFF_BOTH)
if(owner.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)) if(owner.legcuffed && (body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)))
owner.visible_message("\The [owner.legcuffed.name] falls off of [owner].", \ owner.visible_message("\The [owner.legcuffed.name] falls off of [owner].", \
"\The [owner.legcuffed.name] falls off you.") "\The [owner.legcuffed.name] falls off you.")

View File

@@ -37,6 +37,7 @@
#include "__DEFINES\global.dm" #include "__DEFINES\global.dm"
#include "__DEFINES\human.dm" #include "__DEFINES\human.dm"
#include "__DEFINES\hydroponics.dm" #include "__DEFINES\hydroponics.dm"
#include "__DEFINES\implants.dm"
#include "__DEFINES\invisibility_defines.dm" #include "__DEFINES\invisibility_defines.dm"
#include "__DEFINES\jukebox.dm" #include "__DEFINES\jukebox.dm"
#include "__DEFINES\lighting.dm" #include "__DEFINES\lighting.dm"