mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Runtime and MC crash fixes
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
var/curloc = user.loc
|
||||
var/targloc = get_turf(target)
|
||||
ready_proj(target, user, quiet, zone_override)
|
||||
if(distro)
|
||||
if(distro && targloc)
|
||||
targloc = spread(targloc, curloc, distro)
|
||||
if(!throw_proj(target, targloc, user, params))
|
||||
return 0
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
var/sawn_state = SAWN_INTACT
|
||||
var/burst_size = 1 //how large a burst is
|
||||
var/fire_delay = 0 //rate of fire for burst firing and semi auto
|
||||
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
|
||||
var/semicd = 0 //cooldown handler
|
||||
var/weapon_weight = WEAPON_LIGHT
|
||||
|
||||
@@ -135,6 +136,8 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(firing_burst)
|
||||
return
|
||||
if(flag) //It's adjacent, is the user, or is on the user's person
|
||||
if(target in user.contents) //can't shoot stuff inside us.
|
||||
return
|
||||
@@ -210,6 +213,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
recoil = initial(recoil)
|
||||
|
||||
if(burst_size > 1)
|
||||
firing_burst = 1
|
||||
for(var/i = 1 to burst_size)
|
||||
if(!user)
|
||||
break
|
||||
@@ -231,6 +235,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
process_chamber()
|
||||
update_icon()
|
||||
sleep(fire_delay)
|
||||
firing_burst = 0
|
||||
else
|
||||
if(chambered)
|
||||
if(!chambered.fire(target, user, params, , suppressed, zone_override))
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
return
|
||||
update_icon()
|
||||
gun.forceMove(user)
|
||||
user.update_inv_back()
|
||||
else
|
||||
user << "<span class='warning'>You are already holding the gun!</span>"
|
||||
else
|
||||
@@ -125,7 +126,6 @@
|
||||
else
|
||||
icon_state = "holstered"
|
||||
|
||||
|
||||
/obj/item/weapon/minigunpack/proc/attach_gun(var/mob/user)
|
||||
if(!gun)
|
||||
gun = new(src)
|
||||
@@ -136,6 +136,7 @@
|
||||
else
|
||||
src.visible_message("<span class='warning'>The [gun.name] snaps back onto the [name]!</span>")
|
||||
update_icon()
|
||||
user.update_inv_back()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun
|
||||
@@ -151,7 +152,7 @@
|
||||
w_class = 5
|
||||
materials = list()
|
||||
burst_size = 5
|
||||
fire_delay = 2
|
||||
fire_delay = 1
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/minigun
|
||||
|
||||
Reference in New Issue
Block a user