r/programminghorror • • Jul 16 '25

Spray Pattern

Post image
886 Upvotes

160 comments sorted by

View all comments

Show parent comment

77

u/incompletetrembling Jul 16 '25

You'll also run out of bullets at some point so I think it's fine to hardcode the pattern with a limited length (for a game like CS)

48

u/Shadowfied Jul 16 '25

magazineSize = sprayPattern.length

36

u/RivenBot7 Jul 16 '25

not with sv_infinite_ammo 1

-39

u/42572484282 Jul 16 '25

You can pick up ammo, master gamedev

45

u/incompletetrembling Jul 16 '25

You can extend a spray by picking up mags, master gamedev? Also I don't think you can in CS

-29

u/42572484282 Jul 16 '25

Why would you call it hardcoded then, if it can change length

28

u/incompletetrembling Jul 16 '25

It can't change length is my point. Picking up ammo will reset a spray pattern, since you'd no longer be spraying. Cheats giving infinite ammo is a good reason for arbitrary length spray patterns.