Author Topic: Patch for Mantis 2467  (Read 1977 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Patch for Mantis 2467
Here's a patch vs trunk for Mantis 2467 - "untargeted heat seekers ignore ship protect"

I also took the liberty of adding a warning if the untargeted heat seeker flag was used without the weapon also having a homing type of HEAT.

Let me know what you think.

Thanks

Code: [Select]
Index: code/weapon/weapons.cpp
===================================================================
--- code/weapon/weapons.cpp (revision 7523)
+++ code/weapon/weapons.cpp (working copy)
@@ -697,6 +697,11 @@
  {
  Warning(LOCATION,"Weapon %s has the \"inherit parent target\" flag, but not the \"child\" flag.  No changes in behavior will occur.", weaponp->name);
  }
+
+ if (!(weaponp->wi_flags & WIF_HOMING_HEAT) && (weaponp->wi_flags2 & WIF2_UNTARGETED_HEAT_SEEKER))
+ {
+ Warning(LOCATION,"Weapon %s has the \"untargeted heat seeker\" flag, but Homing Type is not set to \"HEAT\".", weaponp->name);
+ }
 }
 
 void parse_shockwave_info(shockwave_create_info *sci, char *pre_char)
@@ -3876,7 +3881,9 @@
  }*/
 
  //WMC - Spawn weapons shouldn't go for protected ships
- if((objp->flags & OF_PROTECTED) && (wp->weapon_flags & WF_SPAWNED))
+ // ditto for untargeted heat seekers - niffiwan
+ if((objp->flags & OF_PROTECTED) &&
+   ((wp->weapon_flags & WF_SPAWNED) || (wip->wi_flags2 & WIF2_UNTARGETED_HEAT_SEEKER)))
  continue;
 
  // Spawned weapons should never home in on their parent - even in multiplayer dogfights where they would pass the iff test below



[attachment deleted by ninja]
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Patch for Mantis 2467
Looks excellent, and good job adding the warning. :yes:  I presume you've tested it in-mission?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Patch for Mantis 2467
Yes, spoon provided me a test mission with a .tbl file (attached to mantis) which I played a number of times, both with & without the patch.  With the patch the modified tornado's ignored my ship quite nicely ;)

I also modified the .tbl file & ran a debug build to ensure the warning was generated (see attached).

For future patches, I'll see if I can get Visual C++ 2010 Express installed somewhere so I can create Windows binaries for other people to test with.  I'll probably be waiting for testers for ages if I just produce Linux test binaries!

[attachment deleted by ninja]
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Patch for Mantis 2467
Super.  I'll bet someone will be along to merge your patch shortly.  I'll do it myself if no one volunteers before this evening.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Patch for Mantis 2467

Took a look at it. Aside from the personal preference of putting the %s as '%s' (to better highlight the Weapon name from everything else, especially one with spaces in it), it looks good and I'd like to commit it (with that slight adjustment).
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Patch for Mantis 2467
Your change sounds good - I agree the quotes will make it clearer.  There's 4 or so similar "if blah then warn" statements above that one that should have the same thing done to them.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Patch for Mantis 2467

I couldn't agree more, but we will keep this commit strictly to the issue at hand.

Committed to Trunk r7537.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Patch for Mantis 2467
Thanks Zacam  :D
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Patch for Mantis 2467
And thank you niffiwan. :)

Now do another one. :D

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Patch for Mantis 2467
Sir! Yes Sir! :p
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

  

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Patch for Mantis 2467
Tested it just now, looks like this has been completely fixed 
Good job :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them