Sanity for funtimes

This commit is contained in:
Chris
2015-01-06 14:46:36 -06:00
parent 4e98e6d977
commit a6c108fcaa
11 changed files with 28 additions and 14 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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")

View File

@@ -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 <B>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
else
src.visible_message("\red <B>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")

View File

@@ -71,5 +71,7 @@
var/obj/structure/grille/Grille = getFromPool(/obj/structure/grille, user.loc)
user << "<span class='notice'>You assembled a grille!</span>"
if(!Grille)
Grille = new(user.loc)
Grille.add_fingerprint(user)
use(2)

View File

@@ -407,6 +407,7 @@ var/const/POS_HEADER = {"<html>
src.attack_hand(usr)
return
if(usr != logged_in)
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)
@@ -471,6 +472,7 @@ var/const/POS_HEADER = {"<html>
if(!newtext) return
var/pid = href_list["setpname"]
var/line_item/LI = products[pid]
if(LI)
LI.name = newtext
products[pid]=LI
else if("setprice" in href_list)

View File

@@ -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"

View File

@@ -373,7 +373,7 @@
if(A && A.anti_ethereal)
mob << "<span class='warning'>A strong force repels you from this area!</span>"
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 << "<span class='warning'>You cannot get past holy grounds while you are in this plane of existence!</span>"
else
mob.loc = get_step(mob, direct)

View File

@@ -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)

View File

@@ -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

View File

@@ -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)