From 3591bd559977f68af34014e0f41ea69cbbc45e4f Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 15:36:27 +0200 Subject: [PATCH 1/6] Travis now builds using version 508.1287 throw is now a keyword. Updates usages where necessary to allow compilation. --- .travis.yml | 4 ++-- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/mob_grab.dm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81b8487f48..1c6b3ecedc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: c env: - BYOND_MAJOR="507" - BYOND_MINOR="1282" + BYOND_MAJOR="508" + BYOND_MINOR="1287" before_install: - sudo apt-get update -qq diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7c3599e726..5b29fa5130 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -285,7 +285,7 @@ if (istype(item, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = item - item = G.throw() //throw the person instead of the grab + item = G.throw_held() //throw the person instead of the grab if(ismob(item)) var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 2d26f3b605..f984274cad 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -41,7 +41,7 @@ ..() //Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code. -/obj/item/weapon/grab/proc/throw() +/obj/item/weapon/grab/proc/throw_held() if(affecting) if(affecting.buckled) return null From 581c9b13080e40da32f0938fbecfae9b23ca2ea2 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 20:14:05 +0200 Subject: [PATCH 2/6] Fixes admin jumps. Changes the checks and message target around, now targets usr instead of src. --- code/modules/admin/verbs/adminjump.dm | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 1ff9a1d1cc..e84543e88f 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -8,8 +8,8 @@ set name = "Jump to Area" set desc = "Area to jump to" set category = "Admin" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -25,8 +25,8 @@ /client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" set category = "Admin" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]") @@ -42,8 +42,8 @@ set category = "Admin" set name = "Jump to Mob" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -65,8 +65,8 @@ set category = "Admin" set name = "Jump to Coordinate" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if (config.allow_admin_jump) @@ -86,8 +86,8 @@ set category = "Admin" set name = "Jump to Key" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -111,8 +111,8 @@ set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] teleported [key_name(M)]") @@ -128,8 +128,8 @@ set name = "Get Key" set desc = "Key to teleport" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -155,8 +155,8 @@ /client/proc/sendmob(var/mob/M in sortmobs()) set category = "Admin" set name = "Send Mob" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return var/area/A = input(usr, "Pick an area.", "Pick an area") in return_sorted_areas() if(A) From 17488168ab3b53d08c7bf40d9f16835198f64234 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 18:49:09 -0500 Subject: [PATCH 3/6] Fixes for #9731 and #9469. --- .../objects/items/weapons/grenades/chem_grenade.dm | 8 ++++++++ code/game/objects/items/weapons/grenades/grenade.dm | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index bb440d1215..b07707107c 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -5,6 +5,7 @@ desc = "A hand made chemical grenade." w_class = 2.0 force = 2.0 + det_time = null var/stage = 0 var/state = 0 var/path = 0 @@ -25,6 +26,7 @@ detonator.detached() usr.put_in_hands(detonator) detonator=null + det_time = null stage=0 icon_state = initial(icon_state) else if(beakers.len) @@ -60,6 +62,12 @@ user.remove_from_mob(det) det.loc = src detonator = det + if(istimer(detonator.a_left)) + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time icon_state = initial(icon_state) +"_ass" name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]" stage = 1 diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index f501753807..1565d321b6 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -47,6 +47,8 @@ if(det_time > 1) user << "The timer is set to [det_time/10] seconds." return + if(det_time == null) + return user << "\The [src] is set for instant detonation." @@ -89,16 +91,16 @@ /obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) if(isscrewdriver(W)) switch(det_time) - if ("1") + if (1) det_time = 10 user << "You set the [name] for 1 second detonation time." - if ("10") + if (10) det_time = 30 user << "You set the [name] for 3 second detonation time." - if ("30") + if (30) det_time = 50 user << "You set the [name] for 5 second detonation time." - if ("50") + if (50) det_time = 1 user << "You set the [name] for instant detonation." add_fingerprint(user) From b1368fb71205d57245b3600d4e44bb26935adfa0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 19:51:33 -0500 Subject: [PATCH 4/6] Changes chemgrenade time in description to be correct after failed detonation. --- code/game/objects/items/weapons/grenades/chem_grenade.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index b07707107c..d90f76771a 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -151,6 +151,13 @@ if(!has_reagents) icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) + spawn(0.001) //Otherwise det_time is erroneously set to 0 after this + if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time return playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1) From 2dbd0ac007209b54df5cf4befe6c5c1ef204eaa2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 22:02:14 -0500 Subject: [PATCH 5/6] Fixes formatting for spawn() before updating description. --- .../objects/items/weapons/grenades/chem_grenade.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index d90f76771a..d181fa38c2 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -152,12 +152,12 @@ icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) spawn(0.001) //Otherwise det_time is erroneously set to 0 after this - if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset - var/obj/item/device/assembly/timer/T = detonator.a_left - det_time = 10*T.time - if(istimer(detonator.a_right)) - var/obj/item/device/assembly/timer/T = detonator.a_right - det_time = 10*T.time + if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time return playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1) From 13a43e6cfd14cf5c876110ec950d09b0de71df4c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 22:35:16 -0500 Subject: [PATCH 6/6] Changes description update spawn() to use 0 instead of small decimal. --- code/game/objects/items/weapons/grenades/chem_grenade.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index d181fa38c2..34dab3bc6e 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -151,7 +151,7 @@ if(!has_reagents) icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) - spawn(0.001) //Otherwise det_time is erroneously set to 0 after this + spawn(0) //Otherwise det_time is erroneously set to 0 after this if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset var/obj/item/device/assembly/timer/T = detonator.a_left det_time = 10*T.time