TG: Runtime fixes for:

runtime error: Cannot modify null.layer. proc name: done
(/obj/effect/equip_e/human/done) usr: Ramona Fawkes (/mob/living/carbon/human)
src: the human (/obj/effect/equip_e/human)
call stack: the human (/obj/effect/equip_e/human): done() the human
(/obj/effect/equip_e/human): process()

runtime error: Cannot execute null.use(). proc name: attackby
(/obj/structure/barricade/wooden/attackby) usr: Jeffery Long
(/mob/living/carbon/human) src: the wooden barricade
(/obj/structure/barricade/wooden) call stack: the wooden barricade
(/obj/structure/barricade/wooden): attackby(null, Jeffery Long
(/mob/living/carbon/human)) the wooden barricade
(/obj/structure/barricade/wooden): DblClick(the floor (159,129,1)
(/turf/simulated/floor), "mapwindow.map", "icon-x=15;icon-y=12;left=1;scr...")

Rewrote wielded weapons to be their own weapon subclass. There was no point
having a var/wielded var/twohanded var/force_unwielded var/force_wielded for
every damn item when there is only 1 wield-able weapon anyway. All the wield-
able stuff is now in twohanded.dm

Changed the adminhelpsound to some creative commons sound I pinched. Until
somebody can get a better one. I'm sick of MAAAAAAAAOOOOOOW.

All PMs trigger the adminhelp sound. That means when you OM a player they get
the sound, if a admin is PMed they only hear it if their adminhelp sounds are
enabled. This should allow people to get eachother's attention when t he chat is
busy.

Fixed some bad code with poddoors (which is used for the shutters in QM)
Revision: r3435
Author: 	 elly1...@rocketmail.com
This commit is contained in:
Ren Erthilo
2012-05-02 23:09:19 +01:00
parent 2d7e329aeb
commit a4e04d2915
20 changed files with 238 additions and 357 deletions
+2 -4
View File
@@ -663,8 +663,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
W.registered_name = M.real_name
M.equip_if_possible(W, M.slot_wear_id)
var/obj/item/weapon/fireaxe/fire_axe = new(M)
fire_axe.name = "Fire Axe (Unwielded)"
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_if_possible(fire_axe, M.slot_r_hand)
if("masked killer")
@@ -679,8 +678,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_l_store)
M.equip_if_possible(new /obj/item/weapon/scalpel(M), M.slot_r_store)
var/obj/item/weapon/fireaxe/fire_axe = new(M)
fire_axe.name = "Fire Axe (Unwielded)"
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_if_possible(fire_axe, M.slot_r_hand)
for(var/obj/item/carried_item in M.contents)
@@ -783,7 +783,7 @@ In all, this is a lot like the monkey code. /N
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? text("[]", r_hand) : "Nothing")]</A>
<BR><B>Head:</B> <A href='?src=\ref[src];item=head'>[(head ? text("[]", head) : "Nothing")]</A>
<BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(wear_suit ? text("[]", wear_suit) : "Nothing")]</A>
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[src];item=pockets'>Empty Pouches</A>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[name];size=340x480"))
+3 -3
View File
@@ -168,9 +168,9 @@
/mob/living/carbon/proc/swap_hand()
var/obj/item/item_in_hand = src.get_active_hand()
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
if(item_in_hand.twohanded == 1)
if(item_in_hand.wielded == 1)
usr << text("Your other hand is too busy holding the []",item_in_hand.name)
if(istype(item_in_hand,/obj/item/weapon/twohanded))
if(item_in_hand:wielded == 1)
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
return
src.hand = !( src.hand )
if (!( src.hand ))
+107 -207
View File
@@ -555,8 +555,8 @@
return
if (!( W.flags & ONBACK ))
return
if(W.twohanded && W.wielded)
usr << "Unwield the [initial(W.name)] first!"
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
return
u_equip(W)
back = W
@@ -1552,7 +1552,6 @@
/obj/effect/equip_e/human/process()
if (item)
item.add_fingerprint(source)
var/item_loc = 0
if (!item)
switch(place)
if("mask")
@@ -1615,218 +1614,119 @@
//SN src = null
del(src)
return
else
switch(place)
if("mask")
if(target.wear_mask)
item_loc = 1
if("l_hand")
if(target.l_hand)
item_loc = 1
if("r_hand")
if(target.r_hand)
item_loc = 1
if("gloves")
if(target.gloves)
item_loc = 1
if("eyes")
if(target.glasses)
item_loc = 1
if("l_ear")
if(target.l_ear)
item_loc = 1
if("r_ear")
if(target.r_ear)
item_loc = 1
if("head")
if(target.head)
item_loc = 1
if("shoes")
if(target.shoes)
item_loc = 1
if("belt")
if(target.belt)
item_loc = 1
if("suit")
if(target.wear_suit)
item_loc = 1
if("back")
if(target.back)
item_loc = 1
if("uniform")
if(target.w_uniform)
item_loc = 1
if("s_store")
if(target.s_store)
item_loc = 1
if("h_store")
if(target.h_store)
item_loc = 1
if("id")
if(target.wear_id)
item_loc = 1
if("internal")
if (target.internal)
item_loc = 1
if("handcuff")
if (target.handcuffed)
item_loc = 1
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel")
if (item && !L.Find(place) && !item_loc)
if ((item && !( L.Find(place) )))
if(isrobot(source) && place != "handcuff")
del(src)
return
for(var/mob/O in viewers(target, null))
O.show_message(text("\red <B>[] is trying to put \a [] on []</B>", source, item, target), 1)
else
if (place == "syringe")
for(var/mob/O in viewers(target, null))
O.show_message(text("\red <B>[] is trying to inject []!</B>", source, target), 1)
else
if (place == "pill")
for(var/mob/O in viewers(target, null))
O.show_message(text("\red <B>[] is trying to force [] to swallow []!</B>", source, target, item), 1)
else
if(place == "fuel")
for(var/mob/O in viewers(target, null))
O.show_message(text("\red [source] is trying to force [target] to eat the [item:content]!"), 1)
var/message=null
switch(place)
if("syringe")
message = text("\red <B>[] is trying to inject []!</B>", source, target)
if("pill")
message = text("\red <B>[] is trying to force [] to swallow []!</B>", source, target, item)
if("fuel")
message = text("\red [source] is trying to force [target] to eat the [item:content]!")
if("drink")
message = text("\red <B>[] is trying to force [] to swallow a gulp of []!</B>", source, target, item)
if("dnainjector")
message = text("\red <B>[] is trying to inject [] with the []!</B>", source, target, item)
if("mask")
if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_mask, target)
else
if (place == "drink")
message = text("\red <B>[] is trying to take off \a [] from []'s head!</B>", source, target.wear_mask, target)
/* if("headset")
message = text("\red <B>[] is trying to take off \a [] from []'s face!</B>", source, target.w_radio, target) */
if("l_hand")
message = text("\red <B>[] is trying to take off \a [] from []'s left hand!</B>", source, target.l_hand, target)
if("r_hand")
message = text("\red <B>[] is trying to take off \a [] from []'s right hand!</B>", source, target.r_hand, target)
if("gloves")
if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.gloves, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s hands!</B>", source, target.gloves, target)
if("eyes")
if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.glasses, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s eyes!</B>", source, target.glasses, target)
if("l_ear")
if(istype(target.l_ear, /obj/item/clothing)&&!target.l_ear:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.l_ear, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s left ear!</B>", source, target.l_ear, target)
if("r_ear")
if(istype(target.r_ear, /obj/item/clothing)&&!target.r_ear:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.r_ear, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s right ear!</B>", source, target.r_ear, target)
if("head")
if(istype(target.head, /obj/item/clothing)&&!target.head:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.head, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s head!</B>", source, target.head, target)
if("shoes")
if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.shoes, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s feet!</B>", source, target.shoes, target)
if("belt")
message = text("\red <B>[] is trying to take off the [] from []'s belt!</B>", source, target.belt, target)
if("suit")
if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
if("back")
message = text("\red <B>[] is trying to take off \a [] from []'s back!</B>", source, target.back, target)
if("handcuff")
message = text("\red <B>[] is trying to unhandcuff []!</B>", source, target)
if("uniform")
if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
if("s_store")
message = text("\red <B>[] is trying to take off \a [] from []'s suit!</B>", source, target.s_store, target)
if("h_store")
message = text("\red <B>[] is trying to empty []'s hat!</B>", source, target)
if("pockets")
for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store))
if(MT.armed)
for(var/mob/O in viewers(target, null))
O.show_message(text("\red <B>[] is trying to force [] to swallow a gulp of []!</B>", source, target, item), 1)
else
if (place == "dnainjector")
for(var/mob/O in viewers(target, null))
O.show_message(text("\red <B>[] is trying to inject [] with the []!</B>", source, target, item), 1)
else
var/message = null
switch(place)
if("mask")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their mask removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) mask</font>")
if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_mask, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s head!</B>", source, target.wear_mask, target)
/* if("headset")
message = text("\red <B>[] is trying to take off \a [] from []'s face!</B>", source, target.w_radio, target) */
if("l_hand")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their left hand item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) left hand item</font>")
message = text("\red <B>[] is trying to take off \a [] from []'s left hand!</B>", source, target.l_hand, target)
if("r_hand")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their right hand item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) right hand item</font>")
message = text("\red <B>[] is trying to take off \a [] from []'s right hand!</B>", source, target.r_hand, target)
if("gloves")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their gloves removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) gloves</font>")
if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.gloves, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s hands!</B>", source, target.gloves, target)
if("eyes")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their eyewear removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) eyewear</font>")
if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.glasses, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s eyes!</B>", source, target.glasses, target)
if("l_ear")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their left ear item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) left ear item</font>")
if(istype(target.l_ear, /obj/item/clothing)&&!target.l_ear:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.l_ear, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s left ear!</B>", source, target.l_ear, target)
if("r_ear")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their right ear item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) right ear item</font>")
if(istype(target.r_ear, /obj/item/clothing)&&!target.r_ear:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.r_ear, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s right ear!</B>", source, target.r_ear, target)
if("head")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their hat removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) hat</font>")
if(istype(target.head, /obj/item/clothing)&&!target.head:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.head, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s head!</B>", source, target.head, target)
if("shoes")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their shoes removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) shoes</font>")
if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.shoes, target)
else
message = text("\red <B>[] is trying to take off the [] from []'s feet!</B>", source, target.shoes, target)
if("belt")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their belt item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) belt item</font>")
message = text("\red <B>[] is trying to take off the [] from []'s belt!</B>", source, target.belt, target)
if("suit")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their suit removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) suit</font>")
if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
if("back")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their back item removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) back item</font>")
message = text("\red <B>[] is trying to take off \a [] from []'s back!</B>", source, target.back, target)
if("handcuff")
message = text("\red <B>[] is trying to unhandcuff []!</B>", source, target)
if("uniform")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their uniform removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) uniform</font>")
if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
if("s_store")
message = text("\red <B>[] is trying to take off \a [] from []'s suit!</B>", source, target.s_store, target)
if("h_store")
message = text("\red <B>[] is trying to empty []'s hat!</B>", source, target)
if("pockets")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their pockets emptied by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to empty [target.name]'s ([target.ckey]) pockets</font>")
for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store))
if(MT.armed)
for(var/mob/O in viewers(target, null))
if(O == source)
O.show_message(text("\red <B>You reach into the [target]'s pockets, but there was a live mousetrap in there!</B>"), 1)
else
O.show_message(text("\red <B>[source] reaches into [target]'s pockets and sets off a hidden mousetrap!</B>"), 1)
target.u_equip(MT)
if (target.client)
target.client.screen -= MT
MT.loc = source.loc
MT.triggered(source, source.hand ? "l_hand" : "r_hand")
MT.layer = OBJ_LAYER
return
message = text("\red <B>[] is trying to empty []'s pockets!!</B>", source, target)
if("CPR")
if (target.cpr_time + 3 >= world.time)
//SN src = null
del(src)
return
message = text("\red <B>[] is trying perform CPR on []!</B>", source, target)
if("id")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their ID removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) ID</font>")
message = text("\red <B>[] is trying to take off [] from []'s uniform!</B>", source, target.wear_id, target)
if("internal")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their internals toggled by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to toggle [target.name]'s ([target.ckey]) internals</font>")
if (target.internal)
message = text("\red <B>[] is trying to remove []'s internals</B>", source, target)
else
message = text("\red <B>[] is trying to set on []'s internals.</B>", source, target)
else
for(var/mob/M in viewers(target, null))
M.show_message(message, 1)
if(O == source)
O.show_message(text("\red <B>You reach into the [target]'s pockets, but there was a live mousetrap in there!</B>"), 1)
else
O.show_message(text("\red <B>[source] reaches into [target]'s pockets and sets off a hidden mousetrap!</B>"), 1)
target.u_equip(MT)
if (target.client)
target.client.screen -= MT
MT.loc = source.loc
MT.triggered(source, source.hand ? "l_hand" : "r_hand")
MT.layer = OBJ_LAYER
return
message = text("\red <B>[] is trying to empty []'s pockets!!</B>", source, target)
if("CPR")
if (target.cpr_time >= world.time + 3)
//SN src = null
del(src)
return
message = text("\red <B>[] is trying perform CPR on []!</B>", source, target)
if("id")
message = text("\red <B>[] is trying to take off [] from []'s uniform!</B>", source, target.wear_id, target)
if("internal")
if (target.internal)
message = text("\red <B>[] is trying to remove []'s internals</B>", source, target)
else
message = text("\red <B>[] is trying to set on []'s internals.</B>", source, target)
for(var/mob/M in viewers(target, null))
M.show_message(message, 1)
spawn( 40 )
done()
return
@@ -1846,7 +1746,7 @@ It can still be worn/put on as normal.
if(source.loc != s_loc) return
if(target.loc != t_loc) return
if(LinkBlocked(s_loc,t_loc)) return
if(item && source.equipped() != item) return
if(item && source.equipped() != item) return
if ((source.restrained() || source.stat)) return
switch(place)
if("mask")
@@ -2856,4 +2756,4 @@ It can still be worn/put on as normal.
else
reset_view(0)
remoteobserve = null
src.tkdisable = 0
src.tkdisable = 0
+2 -14
View File
@@ -191,28 +191,16 @@
var/obj/item/W = equipped()
if (W)
if(W.twohanded)
if(W.wielded)
if(hand)
var/obj/item/weapon/offhand/O = r_hand
del O
else
var/obj/item/weapon/offhand/O = l_hand
del O
W.wielded = 0 //Kinda crude, but gets the job done with minimal pain -Agouri
W.name = "[initial(W.name)]" //name reset so people don't see world fireaxes with (unwielded) or (wielded) tags
W.update_icon()
u_equip(W)
if (client)
client.screen -= W
if (W)
W.layer = initial(W.layer)
if(target)
W.loc = target.loc
else
W.loc = loc
W.dropped(src)
if (W)
W.layer = initial(W.layer)
var/turf/T = get_turf(loc)
if (istype(T))
T.Entered(W)
@@ -235,7 +223,7 @@
return r_hand
/mob/proc/get_inactive_hand()
if ( ! hand)
if (!hand)
return l_hand
else
return r_hand