Nuclear missile silo

computer.cpp
case COMPACT_MISS_LAUNCH:

As I understand missile silo bug has been in the game for a few years now. There are actually three things this part of the code is supposed to do, and only one of them works, which is launching a nuke. What is not working, and can also screw the map or crash the game, is formation of nuke gas and removal of the missile from the silo after the launch.

Here is how to fix all that:

  case COMPACT_MISS_LAUNCH: {
// Target Acquisition.
   point target = g->cur_om.choose_point(g, 0);
   if (target.x == -1) {
//    print_line("Launch canceled.");
    g->add_msg("Target Acquisition canceled");	

    return;
   }

   if(query_yn("Confirm nuclear missile launch."))
   {
//CAT-s: rocket
	playSound(61);
	g->add_msg("Nuclear missile launched!");	
   }
   else	
   {
      g->add_msg("Nuclear missile launched aborted.");
	return;
   }

//   g->add_msg("x: %d, y: %d",  g->u.posx, g->u.posy);
   g->refresh_all();

//CAT-mgs: quick replacement
   for(int i= g->u.posx +8; i < g->u.posx +15; i++)
   {
    for(int j= g->u.posy +3; j < g->u.posy +12; j++)
    {

	if(one_in(4))
		g->explosion(i+rng(-1,1), j+rng(-1,1), rng(4,10), 0, true);
	else
	      g->m.add_field(NULL, i+rng(-2,2), j+rng(-2,2), fd_nuke_gas, rng(1,9));

    }
   }


//CAT-mgs: not working vvv
//...ERASE MISSILE, OPEN SILO, DISABLE COMPUTER 
// For each level between here and the surface, remove the missile
   for (int level = g->levz; level <= 0; level++)
   {

//CAT-mg: fix 1
	map tmpmap(&g->itypes, &g->mapitems, &g->traps);
	tmpmap.load(g, g->levx, g->levy, level, false);

	if(level < 0)
		tmpmap.translate(t_missile, t_hole);
	else
	if(level == 0)
		tmpmap.translate(t_metal_floor, t_hole);

//CAT-mg: fix 2
	tmpmap.save(&g->cur_om, g->turn, g->levx, g->levy, level);
   }

   for(int x = target.x - 2; x <= target.x + 2; x++)
   {
	for(int y = target.y -  2; y <= target.y + 2; y++)
		g->nuke(x, y);
   }

    activate_failure(g, COMPFAIL_SHUTDOWN);

  } break;

I added fires and launch explosions animation beside nuke gas, and also for surface hatch to get open.

Why don’t you just add this to github?

This didn’t work locally. Something about it using functions that do not exist. Edit2: the playsound thingy.

The nuke also doesn’t kill npcs.

What github? Why?

This didn't work locally. Something about it using functions that do not exist. Edit2: the playsound thingy.

The nuke also doesn’t kill npcs.

So I guess you made it work after all by removing playSound() call. If you are using official build and playing on Windows you will also see no explosions animation. Are you playing on Linux maybe, are animations there?

Yeah, NPCs seem immune to nuke gas, fire and explosions, but the problem is not in this part of the code. In the meantime I added zombie soldiers to spawn in that room, behind the glass, they do get cooked when you launch the nuke.

What github? Why?[/quote]

GitHub - TheDarklingWolf/Cataclysm-DDA: Cataclysm - Dark Days Ahead. The main branch has been moved to http://github.com/CleverRaven/Cataclysm-DDA. This is now just my personal branch. this one. The central DDA repository. The place where people try to get the fixes etc. Just putting code here on the forum is not likely to get it noticed.

Do I have access to central DDA repository?

Beside, isn’t this forum called “Bug Reports and Technical Help” and is the place where people are explicitly advised to report the bugs to? The game says “Please report bugs to TheDarklingWolf@gmail.com or post on the forums”. So what are you talking about, how is it not likely bug reports to get noticed here in “Bug Reports” forum?

[quote=“LazyCat, post:5, topic:805”]Do I have access to central DDA repository?

Beside, isn’t this forum called “Bug Reports and Technical Help” and is the place where people are explicitly advised to report the bugs to? The game says “Please report bugs to TheDarklingWolf@gmail.com or post on the forums”. So what are you talking about, how is it not likely bug reports to get noticed here in “Bug Reports” forum?[/quote]

Everyone already has access to download from the central repository, and you don’t need to be a manager of the main branch to submit a pull request, which is how most people are submitting code to the project.

It’s much faster and easier for the branch managers to press a few buttons to merge a pull request than it is for them to manually add your code from a forum post, and so they are much more likely to merge your code if you do this their way.

So, what does it take to make a pull request? Is it easier than 2 seconds copy/paste?

It's much faster and easier for the branch managers to press a few buttons to merge a pull request than it is for them to manually add your code from a forum post, and so they are much more likely to merge your code if you do this their way.

How much harder is to simply copy/paste it? Can they not put it in the git themselves?

More likely to merge? And it depends on me, somehow. What are you saying there, they will not fix their own bugs if I don’t waste my time to dance and feed them with a silver spoon? Are you suggesting I should care their bugs will be fixed more than them? Why? Doesn’t make any sense. Just forget it then I fixed anything, consider it simply a bug report.

2 second copy past stuff goes wrong A LOT. (Look, “playSound(61);” which you have not even fixed).

That is why people invented stuff like version systems. (And the versioning systems have evolved from CVS -> SVN -> Mercurial/Github). Sure there is a little bit of process overhead, via the websites. But it makes it a lot clearer for everybody. See who wrote what, where the stuff came from. Not to mention easier fixing of merge conflicts.

No developer is an island. And if you want your stuff to be adapted by others you will have to work with them. Tis how the world works. 2 second copy paste is easier for YOU, not for the rest of us.

So, what does it take to make a pull request? Is it easier than 2 seconds copy/paste?

It's much faster and easier for the branch managers to press a few buttons to merge a pull request than it is for them to manually add your code from a forum post, and so they are much more likely to merge your code if you do this their way.

How much harder is to simply copy/paste it? Can they not put it in the git themselves?

More likely to merge? And it depends on me, somehow. What are you saying there, they will not fix their own bugs if I don’t waste my time to dance and feed them with a silver spoon? Are you suggesting I should care their bugs will be fixed more than them? Why? Doesn’t make any sense. Just forget it then I fixed anything, consider it simply a bug report.[/quote]

To put it another way:

Unless you make a pull request on github, your changes will not be merged.

I’m lazy.

That is why people invented stuff like version systems. (And the versioning systems have evolved from CVS -> SVN -> Mercurial/Github). Sure there is a little bit of process overhead, via the websites. But it makes it a lot clearer for everybody. See who wrote what, where the stuff came from. Not to mention easier fixing of merge conflicts.

No developer is an island. And if you want your stuff to be adapted by others you will have to work with them. Tis how the world works. 2 second copy paste is easier for YOU, not for the rest of us.

I’m not preventing anyone to use whatever tools they want, in whichever way they wish, and upload the code to wherever they please. If it’s so easy and git makes it so much better go ahead and put it there, I don’t mind.

[quote=“Williham, post:9, topic:805”]To put it another way:

Unless you make a pull request on github, your changes will not be merged.[/quote]

And how does that concern me? If you prefer bugs, you can keep them. The bug report and even the code how to fix it is here right in front of everyone’s nose, and you’re telling me now the bug is not going to be fixed just because I don’t use git? It’s totally insane and up side down, as if they are going to do me some favour by fixing their own bugs. Sorry for trying to help. It takes five seconds to copy/paste that block of code and fix the bug, take it or leave it.

What? It isn’t about you vs anybody else, it is about working together to improve something. This isn’t about you. (well, it is in so far that you just do not attempt to cooperate, but you obviously want people to see your work (or you would not share). But you do not want to spend a few more minutes just uploading it via the usual process. If this is because you fear people finding actual bugs in your code, a false sense of hero complex, or just some anti social issues. I dont know).

But longer to see what was changed, which is important in order to see that your fix is correct.

Basically, inclusion in the mainline repo requires some investment of time by the core devs, time they could be using to merge other code, or write new code of their own. If the proposed change is small, or if it’s submitted via proper channels, that decreases the amount of time they have to spend, and hence increases the chance that it will be included. Likewise, if the proposed change clearly fixes a high-priority issue, then it’s more likely to be included.

I’m not trying to pass judgement here, just explaining why people can get annoyed with the code submission methods you’re choosing to use.

It’s not usual process for me. If it’s so easy, what’s the problem, is there anything preventing anyone to upload it wherever they want? If you want it in a git, just put it there already, why bother me about it?

If this is because you fear people finding actual bugs in your code, a false sense of hero complex, or just some anti social issues. I dont know).

If you can’t read the code just try it out. As I explained there are two bugs here, not in my code but in the official build. It has been reported and talked about before, the bug has been there for more than a year. My code quite apparently fixes both bugs as I explained already and is self-evident from the code, try it out and see for yourself.

No. I’m not preventing anyone to use git or whatever tools they want. Just run the binary if you can’t read the code, try it out, there is no any question about which code is correct and which is not. For a programmer it should be very easy to see what has changed and where the bug is, especially since I marked it with tags:

//CAT-mgs: quick replacement

//CAT-mg: fix 1

//CAT-mg: fix 2

Or just use your damn git and version control tools to tell you what the diffs are.

Basically, inclusion in the mainline repo requires some investment of time by the core devs, time they could be using to merge other code, or write new code of their own. If the proposed change is small, or if it's submitted via proper channels, that decreases the amount of time they have to spend, and hence increases the chance that it will be included. Likewise, if the proposed change clearly fixes a high-priority issue, then it's more likely to be included.

I’m not trying to pass judgement here, just explaining why people can get annoyed with the code submission methods you’re choosing to use.

The simple fact is there are two bugs in the missile silo code which can be fixed in five seconds by copy/pasting. The code also can be uploaded to git by whomever wishes to do so and be fixed whichever other way they desire. I’m not preventing anyone to do anything. You are unnecessarily asking of me to do things for you that you can easily do yourself, it’s inappropriate. Just consider it a bug report, forget I fixed anything, go ahead and fix it from scratch if you prefer, or keep the bugs. Suit yourself.

High priority issues? You mean like the game crashing, freezing and glitching? I fixed most, if not all of it, I posted about it and the source code is available for download. The most important things even ended up in a git thanks to Tase:

…and yet two more builds were released after that, not fixing but keeping those most horrible of bugs. More bugs are being introduced with every new release than that are being fixed. And you are talking to me about priorities and correctness? Ay, caramba!

No one is saying you’re preventing anyone from doing anything.

People are asking you to submit your code the same way everyone else working on the project is. It is not inappropriate to ask someone to do that. Everyone else who wants changes merged are doing that. If it’s just a simple issue of copy pasting it quickly, I really don’t understand what the problem with putting it there is?

I think what people are trying to say is: you spent the time to write a fix, so it is also your responsibility to submit it properly. Nobody’s forcing you to do that, but you are the one upset about the bugs, and you spent your time trying to be helpful, so why be stubborn at the last hurdle and waste all that effort? It’s like you ran a marathon and refuse to cross the finishing line because it’s the wrong colour. :stuck_out_tongue:

This is an opensource project, all the devs here are volunteers. You can help, or not, but don’t whine that they use a system you’re not familiar with. The whole project structure is not going to change for your sole benefit. You must change for theirs. Your fixes are appreciated, but they are as worthless posted here as an unsent email.

No one is saying you’re preventing anyone from doing anything.

People are asking you to submit your code the same way everyone else working on the project is. It is not inappropriate to ask someone to do that. Everyone else who wants changes merged are doing that. If it’s just a simple issue of copy pasting it quickly, I really don’t understand what the problem with putting it there is?[/quote]

Yes, the code could be simply copy-pasted in five seconds, without any git, uploading or downloading. But if git makes things easier for you go ahead and use it. I don’t know how to do it, I don’t use git, and if you do why in the world would you not do it yourself then, as you normally do?

I’m not preventing anyone to do anything. Who wants in a git can put it there, what’s the problem?

This is an opensource project, all the devs here are volunteers. You can help, or not, but don't whine that they use a system you're not familiar with. The whole project structure is not going to change for your sole benefit. You must change for theirs.

This is a simple matter of changing few lines of code and fixing two bugs. I don’t see there is anything more to say about it.

Your fixes are appreciated, but they are as worthless posted here as an unsent email.

The title of this forum is “Bug Reports and Technical Help”.

[quote=“LazyCat, post:19, topic:805”]

Your fixes are appreciated, but they are as worthless posted here as an unsent email.

The title of this forum is “Bug Reports and Technical Help”.[/quote]

You’ll notice that nowhere in the title of the forum does it say “Contributions”.

If you want your stuff included, use git and submit your fixes as pull requests through github.

If you don’t care, keep being lazy and wilfully ignorant.

Tools like git are used to make things easier. Not easier on you, not easier on me, not easier on the maintainers; just easier. For everyone.

If you can’t get behind that, that’s your loss.