Bugfixes for NTSL. AIs can now use script consoles. Fixes crashes.

Buffs metroid magic. More core uses!

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3334 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
vageyenaman@gmail.com
2012-03-21 02:53:07 +00:00
parent 8b006388f8
commit 7ec3b8503b
10 changed files with 70 additions and 29 deletions

View File

@@ -882,7 +882,7 @@
reagents = R
R.my_atom = src
POWERFLAG = rand(1,10)
Uses = rand(2, 5)
Uses = rand(7, 25)
//flags |= NOREACT
spawn()

View File

@@ -218,6 +218,8 @@
return max(low,min(high,num))
/proc/dd_replacetext(text, search_string, replacement_string)
if(!text || !search_string || !replacement_string)
return null
var/textList = dd_text2list(text, search_string)
return dd_list2text(textList, replacement_string)
@@ -1339,7 +1341,7 @@ proc/listclearnulls(list/list)
var/y_pos = null
var/z_pos = null
/area/proc/move_contents_to(var/area/A, var/turftoleave=null)
/area/proc/move_contents_to(var/area/A, var/turftoleave=null, var/direction = null)
//Takes: Area. Optional: turf type to leave behind.
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
@@ -1398,7 +1400,39 @@ proc/listclearnulls(list/list)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
/* Quick visual fix for some weird shuttle corner artefacts when on transit space tiles */
if(direction && findtext(X.icon_state, "swall_s"))
// Spawn a new shuttle corner object
var/obj/corner = new()
corner.loc = X
corner.density = 1
corner.anchored = 1
corner.icon = X.icon
corner.icon_state = dd_replacetext(X.icon_state, "_s", "_f")
corner.tag = "delete me"
corner.name = "wall"
// Find a new turf to take on the property of
var/turf/nextturf = get_step(corner, direction)
if(!nextturf)
nextturf = get_step(corner, turn(direction, 180))
// Take on the icon of a neighboring scrolling space icon
X.icon = nextturf.icon
X.icon_state = nextturf.icon_state
for(var/obj/O in T)
// Reset the shuttle corners
if(O.tag == "delete me")
X.icon = 'shuttle.dmi'
X.icon_state = dd_replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state
X.name = "wall"
del(O) // prevents multiple shuttle corners from stacking
continue
if(!istype(O,/obj)) continue
O.loc = X
for(var/mob/M in T)

View File

@@ -195,7 +195,7 @@
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
if(newnet && (usr in range(1, src) || issilicon(usr)))
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"

View File

@@ -90,14 +90,18 @@
del(src)
attack_ai(var/mob/user as mob)
attack_hand(user)
attack_hand(var/mob/user as mob)
// You need a multitool to use this.
if(user.equipped())
if(!istype(user.equipped(), /obj/item/device/multitool))
// You need a multitool to use this, or be silicon
if(!issilicon(user))
if(user.equipped())
if(!istype(user.equipped(), /obj/item/device/multitool))
return
else
return
else
return
if(stat & (BROKEN|NOPOWER) || !on)
return
@@ -150,11 +154,12 @@
Topic(href, href_list)
if(usr.equipped())
if(!istype(usr.equipped(), /obj/item/device/multitool))
if(!issilicon(usr))
if(usr.equipped())
if(!istype(usr.equipped(), /obj/item/device/multitool))
return
else
return
else
return
if(stat & (BROKEN|NOPOWER) || !on)
return

View File

@@ -108,7 +108,7 @@
if(href_list["network"])
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
if(newnet && (usr in range(1, src) || issilicon(usr)))
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"

View File

@@ -189,7 +189,7 @@
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
if(newnet && (usr in range(1, src) || issilicon(usr)))
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"

View File

@@ -745,7 +745,7 @@ datum
if(M:eyecheck() <= 0)
flick("e_flash", M.flash)
for(var/i = 1, i <= created_volume, i++)
for(var/i = 1, i <= created_volume + rand(1,2), i++)
var/chosen = pick(borks)
var/obj/B = new chosen
if(B)

View File

@@ -1,7 +1,7 @@
client/verb/tcssave()
set hidden = 1
if(mob.machine)
if(istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob) || issilicon(mob)))
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -23,8 +23,8 @@ client/verb/tcssave()
client/verb/tcscompile()
set hidden = 1
if(mob.machine)
if(istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob) || issilicon(mob)))
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -74,8 +74,8 @@ client/verb/tcscompile()
client/verb/tcsrun()
set hidden = 1
if(mob.machine)
if(istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob) || issilicon(mob)))
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -140,8 +140,8 @@ client/verb/tcsrun()
client/verb/exittcs()
set hidden = 1
if(mob.machine)
if(istype(mob.machine, /obj/machinery/computer/telecomms/traffic))
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode == mob)
Machine.storedcode = "[winget(mob, "tcscode", "text")]"
@@ -152,8 +152,8 @@ client/verb/exittcs()
client/verb/tcsrevert()
set hidden = 1
if(mob.machine)
if(istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob) || issilicon(mob)))
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return

View File

@@ -190,7 +190,7 @@ datum/signal
if(istext(address))
var/obj/machinery/telecomms/server/S = data["server"]
if(!value)
if(!value && value != 0)
return S.memory[address]
else
@@ -204,7 +204,7 @@ datum/signal
var/obj/machinery/telecomms/server/S = data["server"]
var/obj/item/device/radio/hradio
if(!message)
if(!message && message != 0)
message = "*beep*"
if(!source)
source = "[html_encode(uppertext(S.id))]"
@@ -215,7 +215,7 @@ datum/signal
freq *= 10 // shift the decimal one place
if(!job)
job = "None"
job = "?"
newsign.data["mob"] = H
newsign.data["mobtype"] = H.type

View File

@@ -53,6 +53,7 @@
if(isobject(e))
if(istype(e, /list))
chosenlist = e
i = 2
else
if(chosenlist)
chosenlist.Add(e)
@@ -66,6 +67,7 @@
if(isobject(e))
if(istype(e, /list))
chosenlist = e
i = 2
else
if(chosenlist)
chosenlist.Remove(e)
@@ -113,7 +115,7 @@
// Clone of copytext()
/proc/docopytext(var/string, var/start = 1, var/end = 0)
if(istext(string) && isnum(start) && isnum(end))
if(length(string) >= end && start > 0)
if(start > 0)
return copytext(string, start, end)
// Clone of length()