Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Sep 13, 2024
1 parent 29a95cd commit cbf2976
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
17 changes: 17 additions & 0 deletions code/modules/projectiles/guns/gun-firing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@
SHOULD_NOT_SLEEP(TRUE)
#warn impl; check unmount

// todo: sigh
var/held_twohanded = TRUE
if(ismob(user))
var/mob/mob_firer = firer
held_twohanded = mob_firer.can_wield_item(src) && is_held_twohanded(mob_firer)

// point of no return
var/obj/projectile/firing_projectile = consume_next_projectile(iteration, firing_flags, firemode, actor, firer)
if(!istype(firing_projectile))
// it's an error code if it's not real
return firing_projectile

// todo: do we really need to newtonian move always?
if(ismovable(firer))
var/atom/movable/movable_firer = firer
movable_firer.newtonian_move(angle2dir(angle))

/**
* Called to handle post fire
*
Expand Down
13 changes: 0 additions & 13 deletions code/modules/projectiles/guns/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,10 @@

next_fire_time = world.time + shoot_time

var/held_twohanded = (user.can_wield_item(src) && src.is_held_twohanded(user))

//actually attempt to shoot
var/turf/targloc = get_turf(target) //cache this in case target gets deleted during shooting, e.g. if it was a securitron that got destroyed.

for(var/i in 1 to burst)
var/obj/projectile = consume_next_projectile(user)
if(!projectile)
handle_click_empty(user)
break

user.newtonian_move(get_dir(target, user)) // Recoil

process_accuracy(projectile, user, target, i, held_twohanded)

Expand Down Expand Up @@ -652,11 +644,6 @@
if(muzzle_flash)
set_light(0)

//obtains the next projectile to fire
#warn get rid of this
/obj/item/gun/proc/consume_next_projectile()
SHOULD_NOT_OVERRIDE(TRUE)

//used by aiming code
/obj/item/gun/proc/can_hit(atom/target as mob, var/mob/living/user as mob)
if(!special_check(user))
Expand Down

0 comments on commit cbf2976

Please sign in to comment.