Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sawed off stocks #58936

Merged
merged 4 commits into from
Jul 4, 2022
Merged

Conversation

bombasticSlacks
Copy link
Contributor

@bombasticSlacks bombasticSlacks commented Jul 3, 2022

Summary

Features "Sawed off stocks"

Purpose of change

resolve #55428

Describe the solution

  • Copied the code for sawing down barrels actor almost identically
  • Added a mod for no stock
  • Added a flag for no stock (reduces length a bit more than a folding stock)
  • Updated the barrel volume of the double barrel and single barrel which were much too low (so that cutting the barrel down actually works at reducing the volume)
  • Added a unit test to check that the double barrel actually fits in a large holster

To avoid complexities the sawed off stock function operates on weapons with an open stock mount slot. This is the mod that is normally reserved for cutting off a legacy wood stock and mounting a bracket / modern stock. So any weapon that has one should be able to be cut down without adding another stock back on.

Describe alternatives you've considered

This never getting done

Testing

the unit test should do most of the work, I'll attach some pics tho

Additional context

Someone should go through and redo barrel volume which seems to have been done incorrectly for just about every gun in the game. Since its really the proportion of the gun that is barrel, not strictly its volume.

image

It fits
image

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Items: Containers Things that hold other things <Enhancement / Feature> New features, or enhancements on existing labels Jul 3, 2022
Copy link
Contributor

@TheShadowFerret TheShadowFerret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIP sawing stocks off M79 or tube 40mm launcher
(Don't actually do this 😛)

data/json/flags.json Outdated Show resolved Hide resolved
data/json/items/gunmod/stock.json Outdated Show resolved Hide resolved
data/json/items/gunmod/stock.json Outdated Show resolved Hide resolved
src/game_inventory.h Outdated Show resolved Hide resolved
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jul 3, 2022
src/item.cpp Outdated Show resolved Hide resolved
Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Enhancement / Feature> New features, or enhancements on existing Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Items: Containers Things that hold other things [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sawing off weapon stocks and better folding stocks
3 participants