mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
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:
@@ -46,7 +46,7 @@ var/global/list/deadmins = list()
|
||||
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.
|
||||
var/global/list/type_instances[0]
|
||||
var/list/type_instances
|
||||
|
||||
/var/global/datum/map/active/map = new() //Current loaded map
|
||||
//Defined in its .dm, see maps/_map.dm for more info.
|
||||
|
||||
2
__DEFINES/implants.dm
Normal file
2
__DEFINES/implants.dm
Normal file
@@ -0,0 +1,2 @@
|
||||
#define IMPLANT_MALFUNCTION_TEMPORARY 1
|
||||
#define IMPLANT_MALFUNCTION_PERMANENT 2
|
||||
@@ -8,6 +8,7 @@
|
||||
return null
|
||||
|
||||
/proc/get_area(const/atom/O)
|
||||
RETURN_TYPE(/area)
|
||||
if(isarea(O))
|
||||
return O
|
||||
var/turf/T = get_turf(O)
|
||||
|
||||
@@ -143,12 +143,6 @@
|
||||
item_attack_delay = held_item.attack_delay
|
||||
var/resolved = held_item.preattack(A, src, 1, params)
|
||||
if(!resolved)
|
||||
if(ismob(A) && modifiers["def_zone"])
|
||||
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)
|
||||
delayNextAttack(item_attack_delay)
|
||||
|
||||
@@ -675,9 +675,8 @@
|
||||
/atom/movable/overlay/New()
|
||||
. = ..()
|
||||
if(!loc)
|
||||
CRASH("[type] created in nullspace.")
|
||||
qdel(src)
|
||||
return
|
||||
CRASH("[type] created in nullspace.")
|
||||
|
||||
master = loc
|
||||
name = master.name
|
||||
|
||||
@@ -104,7 +104,9 @@
|
||||
//testing("[gene.name] deactivated!")
|
||||
var/tempflag = flags
|
||||
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)
|
||||
if(M)
|
||||
//testing("Removing [gene.name]([gene.type]) from activegenes")
|
||||
|
||||
@@ -48,8 +48,8 @@ var/global/datum/controller/occupations/job_master
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/controller/occupations/proc/GetJob(var/rank)
|
||||
RETURN_TYPE(/datum/job)
|
||||
if(!rank)
|
||||
return null
|
||||
for(var/datum/job/J in occupations)
|
||||
|
||||
@@ -75,7 +75,7 @@ var/global/list/alien_whitelist = list()
|
||||
|
||||
// Occupation is in whitelist (for lizard janitors :V)
|
||||
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 0
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define MALFUNCTION_TEMPORARY 1
|
||||
#define MALFUNCTION_PERMANENT 2
|
||||
/obj/item/weapon/implant
|
||||
name = "implant"
|
||||
icon = 'icons/obj/device.dmi'
|
||||
@@ -46,7 +44,7 @@
|
||||
name = "melted implant"
|
||||
desc = "Charred circuit in melted plastic case. Wonder what that used to be..."
|
||||
icon_state = "implant_melted"
|
||||
malfunction = MALFUNCTION_PERMANENT
|
||||
malfunction = IMPLANT_MALFUNCTION_PERMANENT
|
||||
|
||||
/obj/item/weapon/implant/Destroy()
|
||||
if(part)
|
||||
@@ -91,7 +89,7 @@
|
||||
activate()
|
||||
|
||||
/obj/item/weapon/implant/explosive/activate()
|
||||
if(malfunction == MALFUNCTION_PERMANENT)
|
||||
if(malfunction == IMPLANT_MALFUNCTION_PERMANENT)
|
||||
return
|
||||
if(iscarbon(imp_in))
|
||||
var/mob/M = imp_in
|
||||
@@ -119,7 +117,7 @@
|
||||
/obj/item/weapon/implant/explosive/emp_act(severity)
|
||||
if(malfunction)
|
||||
return
|
||||
malfunction = MALFUNCTION_TEMPORARY
|
||||
malfunction = IMPLANT_MALFUNCTION_TEMPORARY
|
||||
switch (severity)
|
||||
if(2.0) //Weak EMP will make implant tear limbs off.
|
||||
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)
|
||||
if (malfunction)
|
||||
return
|
||||
malfunction = MALFUNCTION_TEMPORARY
|
||||
malfunction = IMPLANT_MALFUNCTION_TEMPORARY
|
||||
|
||||
switch(severity)
|
||||
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
|
||||
if (malfunction) //so I'm just going to add a meltdown chance here
|
||||
return
|
||||
malfunction = MALFUNCTION_TEMPORARY
|
||||
malfunction = IMPLANT_MALFUNCTION_TEMPORARY
|
||||
|
||||
activate("emp") //let's shout that this dude is dead
|
||||
if(severity == 1)
|
||||
if(prob(40)) //small chance of obvious meltdown
|
||||
meltdown()
|
||||
else //but more likely it will just quietly die
|
||||
malfunction = MALFUNCTION_PERMANENT
|
||||
malfunction = IMPLANT_MALFUNCTION_PERMANENT
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
|
||||
@@ -530,15 +528,15 @@ the implant may become unstable and either pre-maturely inject the subject or si
|
||||
name = "denatured implant"
|
||||
desc = "A dead, hollow implant. Wonder what it used to be..."
|
||||
icon_state = "implant_melted"
|
||||
malfunction = MALFUNCTION_PERMANENT
|
||||
malfunction = IMPLANT_MALFUNCTION_PERMANENT
|
||||
|
||||
/obj/item/weapon/implant/peace/process()
|
||||
var/mob/living/carbon/host = imp_in
|
||||
|
||||
if (isnull(host) && imp_alive)
|
||||
malfunction = MALFUNCTION_PERMANENT
|
||||
malfunction = IMPLANT_MALFUNCTION_PERMANENT
|
||||
|
||||
if (malfunction == MALFUNCTION_PERMANENT)
|
||||
if (malfunction == IMPLANT_MALFUNCTION_PERMANENT)
|
||||
meltdown()
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
@@ -547,11 +545,11 @@ the implant may become unstable and either pre-maturely inject the subject or si
|
||||
imp_alive = 1
|
||||
|
||||
if (host.nutrition <= 0 || host.reagents.has_reagent(METHYLIN, 15))
|
||||
malfunction = MALFUNCTION_TEMPORARY
|
||||
malfunction = IMPLANT_MALFUNCTION_TEMPORARY
|
||||
else
|
||||
malfunction = 0
|
||||
|
||||
if (!imp_msg_debounce && malfunction == MALFUNCTION_TEMPORARY)
|
||||
if (!imp_msg_debounce && malfunction == IMPLANT_MALFUNCTION_TEMPORARY)
|
||||
imp_msg_debounce = 1
|
||||
to_chat(host, "<span class = 'warning'>Your rage bubbles, \the [src] inside you is being suppressed!</span>")
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#define MALFUNCTION_TEMPORARY 1
|
||||
#define MALFUNCTION_PERMANENT 2
|
||||
|
||||
/obj/item/weapon/implant/tracking
|
||||
name = "tracking implant"
|
||||
desc = "Track with this."
|
||||
@@ -34,7 +31,7 @@ Implant Specifics:<BR>"}
|
||||
/obj/item/weapon/implant/tracking/emp_act(severity)
|
||||
if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning
|
||||
return
|
||||
malfunction = MALFUNCTION_TEMPORARY
|
||||
malfunction = IMPLANT_MALFUNCTION_TEMPORARY
|
||||
|
||||
var/delay = 20
|
||||
switch(severity)
|
||||
@@ -174,11 +171,11 @@ var/list/locator_holomap_cache = list()
|
||||
continue
|
||||
if(TU.z != T.z)
|
||||
continue
|
||||
if (implant.malfunction == MALFUNCTION_PERMANENT)
|
||||
if (implant.malfunction == IMPLANT_MALFUNCTION_PERMANENT)
|
||||
continue
|
||||
var/mob/M
|
||||
var/marker_state = "tracker"
|
||||
if (implant.malfunction == MALFUNCTION_TEMPORARY)
|
||||
if (implant.malfunction == IMPLANT_MALFUNCTION_TEMPORARY)
|
||||
marker_state = "tracker-malfunction"
|
||||
if (implant.loc != implant.imp_in)
|
||||
marker_state = "tracker-dead"
|
||||
@@ -290,6 +287,3 @@ var/list/locator_holomap_cache = list()
|
||||
legend.pixel_x = 7*WORLD_ICON_SIZE
|
||||
legend.pixel_y = 7*WORLD_ICON_SIZE
|
||||
station_map.overlays += legend
|
||||
|
||||
#undef MALFUNCTION_TEMPORARY
|
||||
#undef MALFUNCTION_PERMANENT
|
||||
|
||||
@@ -19,7 +19,6 @@ BSQL_PROTECT_DATUM(/datum/BSQL_Connection)
|
||||
var/error = world._BSQL_Internal_Call("CreateConnection", connection_type, "[asyncTimeout]", "[blockingTimeout]", "[threadLimit]")
|
||||
if(error)
|
||||
BSQL_ERROR(error)
|
||||
return
|
||||
|
||||
id = world._BSQL_Internal_Call("GetConnection")
|
||||
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)
|
||||
if(error)
|
||||
BSQL_ERROR(error)
|
||||
return
|
||||
|
||||
var/op_id = world._BSQL_Internal_Call("GetOperation")
|
||||
if(!op_id)
|
||||
BSQL_ERROR("Library failed to provide connect operation for connection id [id]([connection_type])!")
|
||||
return
|
||||
|
||||
return new /datum/BSQL_Operation(src, op_id)
|
||||
|
||||
@@ -51,12 +48,10 @@ BSQL_DEL_PROC(/datum/BSQL_Connection)
|
||||
var/error = world._BSQL_Internal_Call("NewQuery", id, query)
|
||||
if(error)
|
||||
BSQL_ERROR(error)
|
||||
return
|
||||
|
||||
var/op_id = world._BSQL_Internal_Call("GetOperation")
|
||||
if(!op_id)
|
||||
BSQL_ERROR("Library failed to provide query operation for connection id [id]([connection_type])!")
|
||||
return
|
||||
|
||||
return new /datum/BSQL_Operation/Query(src, op_id)
|
||||
|
||||
|
||||
@@ -15,19 +15,16 @@
|
||||
if(!fexists(libPath))
|
||||
BSQL_DEL_CALL(caller)
|
||||
BSQL_ERROR("Could not find [libPath]!")
|
||||
return
|
||||
|
||||
var/version = _BSQL_Internal_Call("Version")
|
||||
if(version != BSQL_VERSION)
|
||||
BSQL_DEL_CALL(caller)
|
||||
BSQL_ERROR("BSQL DMAPI version mismatch! Expected [BSQL_VERSION], got [version == null ? "NULL" : version]!")
|
||||
return
|
||||
|
||||
var/result = _BSQL_Internal_Call("Initialize")
|
||||
if(result)
|
||||
BSQL_DEL_CALL(caller)
|
||||
BSQL_ERROR(result)
|
||||
return
|
||||
_BSQL_Initialized(TRUE)
|
||||
|
||||
/world/proc/_BSQL_Initialized(new_val)
|
||||
|
||||
@@ -22,7 +22,6 @@ BSQL_DEL_PROC(/datum/BSQL_Operation)
|
||||
var/result = world._BSQL_Internal_Call("OpComplete", connection.id, id)
|
||||
if(!result)
|
||||
BSQL_ERROR("Error fetching operation [id] for connection [connection.id]!")
|
||||
return
|
||||
return result == "DONE"
|
||||
|
||||
/datum/BSQL_Operation/GetError()
|
||||
@@ -43,5 +42,4 @@ BSQL_DEL_PROC(/datum/BSQL_Operation)
|
||||
if(error == "Operation timed out!") //match this with the implementation
|
||||
return FALSE
|
||||
BSQL_ERROR("Error waiting for operation [id] for connection [connection.id]! [error]")
|
||||
return
|
||||
return TRUE
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
/client/proc/admin_memo(task in list("write","show","delete"))
|
||||
set name = "Memo"
|
||||
set category = "Server"
|
||||
if(!ENABLE_MEMOS)
|
||||
#if !ENABLE_MEMOS
|
||||
return
|
||||
#endif
|
||||
if(!check_rights(0))
|
||||
return
|
||||
switch(task)
|
||||
|
||||
@@ -272,7 +272,6 @@ Works together with spawning an observer, noted above.
|
||||
return "health0"
|
||||
else
|
||||
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.
|
||||
/mob/dead/proc/process_medHUD(var/mob/M)
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
|
||||
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
|
||||
|
||||
languages.Add(new_language)
|
||||
@@ -332,9 +332,7 @@
|
||||
|
||||
// Can we speak this language, as opposed to just understanding it?
|
||||
/mob/proc/can_speak_lang(datum/language/speaking)
|
||||
|
||||
|
||||
return (universal_speak || speaking in src.languages)
|
||||
return (universal_speak || (speaking in src.languages))
|
||||
|
||||
//TBD
|
||||
/mob/verb/check_languages()
|
||||
|
||||
@@ -411,7 +411,7 @@
|
||||
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
|
||||
//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)
|
||||
if(status_flags & GODMODE || M_NO_SHOCK in src.mutations)
|
||||
if(status_flags & GODMODE || (M_NO_SHOCK in src.mutations))
|
||||
return 0 //godmode
|
||||
|
||||
if (!def_zone)
|
||||
|
||||
@@ -467,16 +467,6 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
/mob/living/carbon/slime/show_inv(mob/user)
|
||||
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()
|
||||
if(status_flags & GODMODE)
|
||||
health = maxHealth
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
return L
|
||||
|
||||
/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
|
||||
|
||||
var/damage = shock_damage * siemens_coeff
|
||||
@@ -473,6 +473,7 @@
|
||||
..()
|
||||
|
||||
/mob/living/proc/get_organ(zone)
|
||||
RETURN_TYPE(/datum/organ/external)
|
||||
return
|
||||
|
||||
//A proc that turns organ strings into a list of organ datums
|
||||
|
||||
@@ -442,7 +442,7 @@ var/bee_mobs_count = 0
|
||||
step_rand(B_mob)
|
||||
|
||||
//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
|
||||
if(istype(M))
|
||||
var/obj/item/clothing/worn_suit = M.wear_suit
|
||||
@@ -600,7 +600,7 @@ var/bee_mobs_count = 0
|
||||
//REACHING FOR FLOWERS
|
||||
if(state == BEE_OUT_FOR_PLANTS && pollinating <= 0)
|
||||
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)
|
||||
wander = 0
|
||||
else
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
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.
|
||||
else
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
@@ -130,7 +130,7 @@
|
||||
if(HOSTILE_STANCE_ALERT)
|
||||
stop_automated_movement = 1
|
||||
var/found_mob = 0
|
||||
if(target && target in ListTargets())
|
||||
if(target && (target in ListTargets()))
|
||||
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++
|
||||
|
||||
@@ -389,8 +389,8 @@
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
alpha_stance = WOLF_ALPHAATTACK
|
||||
alpha_target = target
|
||||
add_attacklogs(pack_alpha, target, "set [src] (wolf) on")
|
||||
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)
|
||||
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])")
|
||||
if(istype (target, /turf)) //We go!
|
||||
alpha_stance = WOLF_ALPHAMOVE
|
||||
alpha_target = target
|
||||
|
||||
@@ -494,11 +494,11 @@
|
||||
return
|
||||
return
|
||||
|
||||
if(parrot_interest && parrot_interest in view(src))
|
||||
if(parrot_interest && (parrot_interest in view(src)))
|
||||
parrot_state = PARROT_SWOOP | PARROT_STEAL
|
||||
return
|
||||
|
||||
if(parrot_perch && parrot_perch in view(src))
|
||||
if(parrot_perch && (parrot_perch in view(src)))
|
||||
parrot_state = PARROT_SWOOP | PARROT_RETURN
|
||||
return
|
||||
|
||||
|
||||
@@ -917,7 +917,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
owner.drop_from_inventory(owner.handcuffed)
|
||||
|
||||
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].", \
|
||||
"\The [owner.legcuffed.name] falls off you.")
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "__DEFINES\global.dm"
|
||||
#include "__DEFINES\human.dm"
|
||||
#include "__DEFINES\hydroponics.dm"
|
||||
#include "__DEFINES\implants.dm"
|
||||
#include "__DEFINES\invisibility_defines.dm"
|
||||
#include "__DEFINES\jukebox.dm"
|
||||
#include "__DEFINES\lighting.dm"
|
||||
|
||||
Reference in New Issue
Block a user