diff --git a/code/__HELPERS/experimental.dm b/code/__HELPERS/experimental.dm index b0715f7b6c9..34368dfbaf3 100644 --- a/code/__HELPERS/experimental.dm +++ b/code/__HELPERS/experimental.dm @@ -71,7 +71,8 @@ var/list/exclude = list("loc", "locs", "parent_type", "vars", "verbs", "type", " #ifdef DEBUG_OBJECT_POOL world << text("DEBUG_OBJECT_POOL: getFromPool([]) [] left.", A, length(masterPool[A])) #endif - + if(!O) + O = new A O.loc = B return O diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 0d819be73bc..a31f7c1ce1a 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -184,7 +184,7 @@ animals lunging, etc. */ /mob/proc/RangedAttack(var/atom/A, var/params) - if(!mutations.len) return + if(!mutations || !mutations.len) return if((M_LASER in mutations) && a_intent == "hurt") LaserEyes(A) // moved into a proc below else if(M_TK in mutations) diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index 49777746d90..678b95ffa63 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -55,6 +55,8 @@ return // For the typer, the input is enabled. Buffer the typed text + if(!istype(editingcode)) + return storedcode = "[winget(editingcode, "tcscode", "text")]" winset(editingcode, "tcscode", "is-disabled=false") diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 3d4a6729dda..3ca3a976b96 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -475,7 +475,7 @@ Alien plants should do something if theres a lot of poison if(health <= 0) return user.delayNextAttack(10) - if(W.attack_verb.len) + if(W.attack_verb && W.attack_verb.len) src.visible_message("\red \The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]") else src.visible_message("\red \The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]") diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 5ee23152e59..55264db9bff 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -71,5 +71,7 @@ var/obj/structure/grille/Grille = getFromPool(/obj/structure/grille, user.loc) user << "You assembled a grille!" + if(!Grille) + Grille = new(user.loc) Grille.add_fingerprint(user) use(2) diff --git a/code/modules/Economy/POS.dm b/code/modules/Economy/POS.dm index af919223dc7..c881a48145d 100644 --- a/code/modules/Economy/POS.dm +++ b/code/modules/Economy/POS.dm @@ -407,7 +407,8 @@ var/const/POS_HEADER = {" src.attack_hand(usr) return if(usr != logged_in) - usr << "\red [logged_in.name] is already logged in. You cannot use this machine until they log out." + if(logged_in) + usr << "\red [logged_in.name] is already logged in. You cannot use this machine until they log out." return if("act" in href_list) switch(href_list["act"]) @@ -471,8 +472,9 @@ var/const/POS_HEADER = {" if(!newtext) return var/pid = href_list["setpname"] var/line_item/LI = products[pid] - LI.name = newtext - products[pid]=LI + if(LI) + LI.name = newtext + products[pid]=LI else if("setprice" in href_list) var/newprice = input(usr,"Enter the product's price.") as num if(!newprice) return diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 48a281b8444..112fbf5dc30 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -117,22 +117,26 @@ set category = "Object" set name = "Adjust welding goggles" set src in usr - - if(usr.canmove && !usr.stat && !usr.restrained()) + var/mob/C = usr + if(!usr) + if(!ismob(loc)) + return + C = loc + if(C.canmove && !C.stat && !C.restrained()) if(src.up) src.up = !src.up src.flags |= GLASSESCOVERSEYES flags_inv |= HIDEEYES icon_state = initial(icon_state) - usr << "You flip the [src] down to protect your eyes." + C << "You flip the [src] down to protect your eyes." else src.up = !src.up src.flags &= ~HEADCOVERSEYES flags_inv &= ~HIDEEYES icon_state = "[initial(icon_state)]up" - usr << "You push the [src] up out of your face." + C << "You push the [src] up out of your face." - usr.update_inv_glasses() + C.update_inv_glasses() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 8366a38f28e..b41d4ce82fb 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -373,7 +373,7 @@ if(A && A.anti_ethereal) mob << "A strong force repels you from this area!" else - if(T.holy && isobserver(mob) && ((mob.invisibility == 0) || (ticker.mode && (mob.mind in ticker.mode.cult)))) + if((T && T.holy) && isobserver(mob) && ((mob.invisibility == 0) || (ticker.mode && (mob.mind in ticker.mode.cult)))) mob << "You cannot get past holy grounds while you are in this plane of existence!" else mob.loc = get_step(mob, direct) diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 9630193daf7..5cdf3191ade 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -464,6 +464,8 @@ datum return add_reagent(var/reagent, var/amount, var/list/data=null) + if(!my_atom) + return 0 if(!isnum(amount)) return 1 update_total() if(total_volume + amount > maximum_volume) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index b26ef639eff..cbf1b71d217 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -3621,7 +3621,8 @@ datum src.data++ var/d = data - + if(!holder) + del(src) // make all the beverages work together for(var/datum/reagent/ethanol/A in holder.reagent_list) if(isnum(A.data)) d += A.data diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index 68690896093..6be2f0590d1 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -28,7 +28,7 @@ if(!istype(L, /list)) return if(isnum(pos)) if(!value) - if(L.len >= pos) + if(L.len >= pos && !(pos > L.len)) return L[pos] else if(L.len >= pos)