So, what happens if (Destiny)
You are not understanding.
I was not understanding the assumptions you were making. I was making or allowing for a greater number of scenarios.
You save the value THE INSTANT BEFORE THE CHARACTER REBUILD HAPPENS. The glitch happens when the character is rebuilt on spawn. So you determine how much ammo you have the nanosecond before spawn, then restore it after spawn.
You assume two things:
1. That the nanosecond before spawn that the ammo count is still available. It may get wiped on death, and rebuilt on life.
2. That there is no scenario where the player does not have time to change the capacity. If the capacity is no longer available after death, and doesn't get instantiated again until life, than you have anywhere between 3 seconds and an infinite time between next spawn.
Also, if you remove the armor in your example while you are alive, the same thing would happen. There is no problem at all with the scenario. If you have 7 ammo, and remove armor pieces that let you have that 7, or course your ammo is going to go down.
That was not my example. My example was having 3 rockets with a capacity of 6. Removing armor while alive that drops your capacity to 4 should have no effect on the 3 rockets you have. If you simply use a percentage total capacity, and there exists time for the player to adjust that capacity between when the current value is no longer accessible and when the value is instantiated again, you will have a problem
That said, ZackDark came up with a solution based on percentage weapon capacity instead of total capacity that I can't find a way to break yet. It might involve changing the variable type (which isn't always an easy task) but functionally I don't see an issue with yet.
Complete thread:
- I can fix the heavy ammo bug -
Cody Miller,
2015-01-26, 17:19
- I can fix the heavy ammo bug -
Claude Errera,
2015-01-26, 17:54
- I can fix the heavy ammo bug -
Cody Miller,
2015-01-26, 17:59
- I can fix the heavy ammo bug - Xenos, 2015-01-26, 18:24
- My limited experience with coding: -
CruelLEGACEY,
2015-01-26, 19:14
- This is a frighteningly accurate metaphor. -
CyberKN,
2015-01-26, 19:59
- This is a frighteningly accurate metaphor. - someotherguy, 2015-01-27, 07:29
- This is a frighteningly accurate metaphor. -
CyberKN,
2015-01-26, 19:59
- I can fix the heavy ammo bug -
Cody Miller,
2015-01-26, 17:59
- I can fix the heavy ammo bug -
uberfoop,
2015-01-26, 18:36
- As a programmer, seems like a pain... -
slycrel,
2015-01-26, 19:30
- As a programmer, seems like a pain... -
stabbim,
2015-01-26, 21:49
- As a debugger, it seems simple - Kahzgul, 2015-01-27, 00:21
- As a programmer, seems like a pain... -
BeardFade,
2015-01-27, 22:15
- As a programmer, seems like a pain... - Ragashingo, 2015-01-27, 22:22
- As a programmer, seems like a pain... -
stabbim,
2015-01-27, 22:49
- They must be dead in some way - Earendil, 2015-01-28, 09:13
- As a programmer, seems like a pain... -
stabbim,
2015-01-26, 21:49
- As a programmer, seems like a pain... -
slycrel,
2015-01-26, 19:30
- I can fix the heavy ammo bug - narcogen, 2015-01-27, 06:13
- FAIL -
Durandal,
2015-01-27, 06:27
- haha - SonofMacPhisto, 2015-01-27, 06:28
- FAIL... to see a problem here. We should do this. :D - INSANEdrive, 2015-01-27, 07:48
- FAIL -
Cody Miller,
2015-01-27, 08:06
- Um -
RaichuKFM,
2015-01-27, 08:16
- Um -
Cody Miller,
2015-01-27, 08:23
- Um -
RaichuKFM,
2015-01-27, 08:28
- Exploitable fix? - dogcow, 2015-01-27, 09:03
- Um -
Cody Miller,
2015-01-27, 09:09
- So, what happens if -
Earendil,
2015-01-27, 09:20
- Earendil be like: - iconicbanana, 2015-01-27, 09:24
- So, what happens if -
Cody Miller,
2015-01-27, 17:13
- So, what happens if - RaichuKFM, 2015-01-27, 18:13
- So, what happens if -
Earendil,
2015-01-28, 09:24
- So, what happens if -
ZackDark,
2015-01-28, 09:55
- That, sir... - Earendil, 2015-01-28, 10:11
- So, what happens if - dogcow, 2015-01-28, 11:00
- So, what happens if -
Cody Miller,
2015-01-28, 11:12
- So, what happens if - Earendil, 2015-01-28, 11:33
- You're assuming the bug is a single-frame thing -
ZackDark,
2015-01-28, 11:42
- You're assuming the bug is a single-frame thing - Ragashingo, 2015-01-28, 12:42
- Depends how ammo is normally calculated - someotherguy, 2015-01-28, 13:47
- So, what happens if -
ZackDark,
2015-01-28, 09:55
- So, what happens if -
Earendil,
2015-01-27, 09:20
- Um -
RaichuKFM,
2015-01-27, 08:28
- Um -
Cody Miller,
2015-01-27, 08:23
- Um -
RaichuKFM,
2015-01-27, 08:16
- why not just increase the drop rate -
Schedonnardus,
2015-01-27, 06:43
- make heavy weap packs cheaper for people who wear the boots? - scarab, 2015-01-27, 07:38
- add ammo synth to blue engram tables - Schedonnardus, 2015-01-27, 08:46
- Seemingly Easy Workaround... -
DiscipleN2k,
2015-01-27, 08:51
- I don't like that -
Earendil,
2015-01-27, 09:22
- How about a toggle... - DiscipleN2k, 2015-01-27, 09:36
- I don't like that -
Earendil,
2015-01-27, 09:22
- Worse than a defect... -
Earendil,
2015-01-27, 09:26
- Worse than a defect... -
Cody Miller,
2015-01-27, 09:32
- Worse than a defect... -
JDQuackers,
2015-01-27, 09:53
- +1 Yep. - BeardFade, 2015-01-28, 08:44
- Worse than a defect... - Earendil, 2015-01-27, 09:55
- Worse than a defect... -
JDQuackers,
2015-01-27, 09:53
- A wise post. - Kermit, 2015-01-28, 09:06
- Worse than a defect... -
Cody Miller,
2015-01-27, 09:32
- Exotic Helmet idea -
Schedonnardus,
2015-01-27, 09:49
- That exotic would destroy crucible -
Spec ops Grunt,
2015-01-27, 16:29
- Non Guardian kills have a chance to… there fixed - Cody Miller, 2015-01-27, 17:12
- Better Yet... - DiscipleN2k, 2015-01-27, 18:02
- That exotic would destroy crucible -
Spec ops Grunt,
2015-01-27, 16:29
- Good attempt. -
BeardFade,
2015-01-27, 22:29
- Good attempt. -
Claude Errera,
2015-01-28, 06:56
- Good attempt. - BeardFade, 2015-01-28, 08:43
- Good attempt. -
Claude Errera,
2015-01-28, 06:56
- I can fix the heavy ammo bug -
Claude Errera,
2015-01-26, 17:54