Author Topic: Patch for Mantis 2468  (Read 2304 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Here's a simple patch for mantis 2468 - the change-ship SEXP doesn't switch the ships armour type.  Both bigchunk1 & myself have tested it and it seems to work as expected.

Funnily enough, the subsystems armour types were being switched, but not the base ship armours  :)

Please let me know if you have any feedback on the patch.

Code: [Select]
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 7735)
+++ code/ship/ship.cpp (working copy)
@@ -8756,6 +8756,12 @@
  Assert(sp->ship_max_hull_strength > 0.0f);
  Assert(objp->hull_strength > 0.0f);
 
+ // niffiwan: set new armor types
+ sp->armor_type_idx = sip->armor_type_idx;
+ sp->shield_armor_type_idx = sip->shield_armor_type_idx;
+ sp->collision_damage_type_idx = sip->collision_damage_type_idx;
+ sp->debris_damage_type_idx = sip->debris_damage_type_idx;
+
  // subsys stuff done only after hull stuff is set
  // if the subsystem list is not currently empty, then we need to clear it out first.
  ship_subsystems_delete(sp);
@@ -16718,4 +16724,4 @@
 void init_path_metadata(path_metadata& metadata)
 {
  vm_vec_zero(&metadata.departure_rvec);
-}
\ No newline at end of file
+}

[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 Echelon9

  • 210
Committed, thanks niffiwan.