Skip to content

Commit

Permalink
Fixes auto unloading for gate loaded revolvers (#3038)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

The bullet physics weren't getting all the parameters they needed when
unload_all_casings called eject_casing so the bullets never left the
chamber as a result. Fixes that.

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

Bug fix good

## Changelog

:cl:
fix: Auto unloading for gate loaded revolvers
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Gristlebee authored May 30, 2024
1 parent 916a276 commit 334da47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
var/doafter_time = 0.4 SECONDS
if(!do_mob(user,user,doafter_time))
break
if(!eject_casing())
if(!eject_casing(user))
doafter_time = 0 SECONDS
else
num_unloaded++
Expand All @@ -122,6 +122,7 @@
to_chat(user, "<span class='warning'>There's nothing in the gate to eject from [src]!</span>")
return FALSE
playsound(src, eject_sound, eject_sound_volume, eject_sound_vary)
casing_to_eject.forceMove(drop_location())
var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180))
casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement)

Expand Down Expand Up @@ -279,7 +280,6 @@
playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)

chamber_round(TRUE)
//playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)
SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD)
update_appearance()

Expand Down

0 comments on commit 334da47

Please sign in to comment.