Last SVN rev 13399, when Torpedo's slot goes empty i'm not able to buy another one directly. It behaves as the slot was full, but there are 0 missiles remaining. The only way seems to be buying another kind of missiles and then replace them with a torpedo. This doesn't happen with other missiles like for es. dumbfire, by now i can't say if torpedos are the only ones. Issue present already in stable (0.5.1 r1) version.
Anonymous
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
link to forum topic: http://forums.vega-strike.org/viewtopic.php?f=2&t=16478&p=131684#p131684
Last edit: Anonymous 2014-03-20
I discuss this bug in the following forum topic:
http://forums.vega-strike.org/viewtopic.php?f=2&t=16478
Here's my proposed fix for the time being:
Index: src/cmd/unit_generic.cpp
--- src/cmd/unit_generic.cpp (revision 13449)
+++ src/cmd/unit_generic.cpp (working copy)
@@ -6366,7 +6366,7 @@
//only look at this mount if it can fit in the rack
if ( (unsigned int) (up->mounts[i].type->size) == (up->mounts[i].type->size&mounts[jmod].size) ) {
if (up->mounts[i].type->weapon_name != mounts[jmod].type->weapon_name || mounts[jmod].status
- == Mount::DESTROYED || mounts[jmod].status == Mount::UNCHOSEN) {
+ == Mount::DESTROYED || mounts[jmod].status == Mount::UNCHOSEN || mounts[jmod].ammo == 0) {
//If missile, can upgrade directly, if other type of ammo, needs actual gun to be present.
if (isammo && !ismissiletype) {
cancompletefully = false;
I've been thinking about it a little bit more and it might be that my proposed batch in section II.A from my long section above is problematic. In any case there's probably a better way to fix the issue. I'll come back soon with another proposal, I just need to find where in the code a ship's mount gets attributed a volume.
This bug looks like it's very similar to an older, closed one which is 1812870.
I made a new patch, which I also submitted to the Review Board
You can find my patch in this forum post:
http://forums.vega-strike.org/viewtopic.php?f=2&t=16478&p=131108#p131108
Thanks for the patch maze. Check the review board, a few fixes and we might get this in (I have to test it against GG though, GG is quite sensitive to ammo stuff).
It's better to use the existing capabilities as intended rather than to use more convoluted conditions. In this case, IsEmpty() is supposed to handle such things. Thus, simply making a missile mount UNCHOSEN when the last missile is shot in Mount::Fire solves everything and makes more sense in that there's no need to indicate it as having 0 ammo - the weapon is truly absent just as if it was uninstalled.
See [patches:#62]
Related
Patches:
#62Last edit: Turbo Beholder 2013-07-21
Alright, I can't reproduce it, but I'll take both your words for it. The patch for making them unchosen seems clean enough.